
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sum month and previous month -
Hi, I see, a lot of this topic, but I have some strange error that I don't understand.
I have a very simple table and calculated MonthAgo and Month Number and Sales. In the last fourth column, I want to show the total sales from the previous month.
My code is:
Sum({<MonthsAgo={"$(= '=' & (Min(MonthsAgo)+1))"}, Month=, Data= >} sales)
Even Qlik tells me it's ok, and yet the third and fourth columns have the same results -> I don't understand it.
Please close the thread by marking correct answer & give likes if you like the post.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
why don't you use below() function ?
=below(TOTAL sum(sales))
in the measure totals expression, select "Sum".
Regards,
Aditya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is because of aggregation in tables,
Your measure is aggregated on Dimension Present in Table according to set analysis,
So if the set and the dimension are conflicting it either gives dimension values or null, Depending upon Qlik version (Sometimes it changes even after Refreshing)
The best way to solve it in UI is aggregating your measure your self on those dimension and change measure into calculative dimension, rather then letting Qlik do it to a measure.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
why don't you use below() function ?
=below(TOTAL sum(sales))
in the measure totals expression, select "Sum".
Regards,
Aditya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is because of aggregation in tables,
Your measure is aggregated on Dimension Present in Table according to set analysis,
So if the set and the dimension are conflicting it either gives dimension values or null, Depending upon Qlik version (Sometimes it changes even after Refreshing)
The best way to solve it in UI is aggregating your measure your self on those dimension and change measure into calculative dimension, rather then letting Qlik do it to a measure.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ajaykakkar93 , thanks for your help but function not working.
@Aditya_Chitale, thanks for your help, It works 🙂
@Gabbar you're right, the function didn't want to work in the standard table.
When I moved it to the piviot table, Row = shops, artId / Column = Values / Measures = function it works very good.
Of course, there was a problem that when adding Column = Months, I can't count e.g. October and September together because there is a FIXED filter for a given month, but I managed to write 12 functions for 12 months...
Please close the thread by marking correct answer & give likes if you like the post.
