Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Newbie needs help with Month To Date

Hi,

I'm an absolute newbie at this and about to make a complete fool of myself I expect but...

I have a table showing total sales this year for a week, total sales last year for the same week, and I also want period to date for this year and last year.

Week, period and year are all variables named ThisWeek, ThisPeriod and ThisYear (ther is also one for LastYear)

Currently the expression looks like this:

Sum (IF(DWH_OP_WEEK <=ThisWeek

AND DWH_OP_DATE_YEAR=ThisYear

AND DWH_OP_DATE_PERIOD=ThisPeriod,SALES_IM_SALES_VALUE_GROSS))

It works fine for period to date at the end of the period, but if I want to look back at week 2 period 1 for example, it still shows me total Period To Date for the whole period (when i only want to see the Period to Date up to week 2).

Any suggestions would be amazing!

Thanks

1 Reply
Anonymous
Not applicable
Author

Hi,

Take a look at the date & time functions (use the F1 help in QV).

Maybe you could use InWeekToDate()? or InMonthToDate()?