Jump to content

Recommended Posts

Posted

I am working in WebFocus Designer. We have a datetime variable represented as: 2022/08/02 01:23:42. For YOY and MONTH over MONTH comparisons, I need to separate those from the mentioned datetime. I need to break down all the output that occured in January, February, etc...only as those months. The same for Year, and MAYBE week if possible.

What is the best and/or quickest way to do this I have tried some but to be frank, I am still learning...lol

 

Edit: I have tried some COMPUTE functions to no avail. I am curious if it is the format the DATETIME is coming in as that keeps COMPUTE from working. I am obviously not sure though. Grouping or BINS do not work either as new data is constantly coming in.

Posted

You could do the COMPUTE calculations as follows, although it might be more appropriate as DEFINE calculations.

COMPUTE Year/I4 = HPART(Date,'YEAR','I2');

COMPUTE Month/I2 = HPART(Date,'MONTH','I2');

COMPUTE YearMonth/I6YYM = 100 * Year + Month;

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...