Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Year, Previous Month

I need to get the sum of revenue for the current year, previous month.

The file that I have loaded contains

Year

Period

Revenue

So if I look at the data today, I want to get the previous month's data, i.e. since today is year 2012 month 09, I want to see all revenue for year 2012 month 08

I am using the following set analysis but it doesn't seem to be working.

Do I have this set up wrong; any suggestions?????

Sum({$<FYear={$(=Max(Year))}, FPeriod={$(=Month(Today()-1))}>}REV_TOTAL)

Labels (1)
4 Replies
alexpanjhc
Specialist
Specialist

Sum({$<FYear={$(=Max(Year))}, FPeriod={$(=Month(Today())-1)}>}REV_TOTAL)

i think the problem is the parenthese is not in the right place.

Not applicable
Author

I made the change you suggested.  When I try to put together the entire calcultion that I'm really trying to get, the program just churns & eventually gets a not responding. 

Could there be something else wrong with my calculation; here it is:

sum([ARBalance])/Sum({$<FYear={$(=Max(Year))}, FPeriod={$(=Month(Today())-1)}>}REV_TOTAL))*30

I'm trying to get the DSO by taking the AR Balance & dividing by last month's sales and then multiplying by number of days in which we are using 30.

alexpanjhc
Specialist
Specialist

is the last parenthese needed? or you are missing a paranthese at the begining?

Sum({$<FYear={$(=Max(Year))}, FPeriod={$(=Month(Today())-1)}>}REV_TOTAL))

MayilVahanan
MVP
MVP

HI

Try like this,

Use AddMonths function

Sum([ARBalance])/Sum({$<FYear={$(=Max(Year))}, FPeriod={$(=AddMonths(Today())-1)}>}REV_TOTAL)

Hope it helps


Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.