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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Month Sales

Hi,

I'm trying to query sales from 8 months ago. Using the following query, I'm able to sum the current month's sales using the following:

[Calendar Month Name] = {'$(=month(now(0)))'}

However I cannot use the above query to sum sales for a previous month. For instance if I try:

[Calendar Month Name] = {'$(=month(now(0)-8))'}

OR

[Calendar Month Name] = {'$(=month(now(0))-8)'}

Both return nothing. Does anyone have an idea what I'm missing? I've searched the forum and have yet to find a solution.

Any help is appreciated.

Matt

Labels (1)
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

[Calendar Month Name] = {'$(=month(AddMonths(now(0), -8)))'}

Hope this helps you.

Regards,

Jagan.

View solution in original post

3 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

[Calendar Month Name] = {'$(=month(AddMonths(now(0), -8)))'}

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Thanks Jagan,

That works perfectly! One issue though. I'm using this with other selections that are overriding the expression. How would I change the following set to ignore current selections and pull the data I'm looking for 8 months ago:

Screen shot 2011-12-15 at 5.08.08 PM.png

I've tried using a 1 intstead of a $ sign expansion, but was unsuccessful.

Thanks again for the help.

Matt

Not applicable
Author

Nevermind, I was able to figure it out, had misplaced my 1, which needs to go at the beginning of the expression.

Best,

Matt