Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum revenue for a specific date

Hi, I have the following formula:

=AddMonths(Date(DATE#(CommonMonth,'YYYY/MM')),-1)

This returns the month previous to the selected date which is what I need, I now need to SUM(PrintRev) for the date this produces but I am confused about how to nest the SUM function,

Thanks

11 Replies
Anonymous
Not applicable
Author

Capture.PNG

So if my current month is October (10) then I  am trying to return September (09) and my expected value would be 4.


Anonymous
Not applicable
Author

Ah I understand, in the formula I am converting 2017/10 to be something like 01/10/2017. This means when I go to look up my new date value in my CommonMonth column there is no such value as 01/10/2017, so I need to convert my date back to the original YYYY/MM format, and it should then find the correct values.

=Sum({<CommonMonth = {"$(=date(AddMonths(Date(DATE#(CommonMonth,'YYYY/MM')),-1),'YYYY/MM'))"}>} PrintRev)

I can confirm this has worked correctly for me. Thank you for your help.