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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

compering between 2 month problem

hello all,

i have some problem with compering between currect month and its previous:

i have an expression that sum the value of the last record (time) in the table.

sum(aggr(FirstSortedValue(Value,Sorted_Ind_From_The_Last_TimeStmp),ID, Name))

now i need to compere between 2 months...

any ideas how to do so ??

thank you all.

1 Reply
swuehl
MVP
MVP

You can probably use set analysis (please check the Help for set analysis if you are not familiar with it) to limit your records you agreggate over to the current month resp. the previous month.

Something along the lines:

=sum( aggr(FirstSortedValue({<YearMonth = {'2012 Jan'}, Month=,Year=,Date=>} Value, Sorted_Ind_From_The_Last_TimeStmp), ID, Name))

and

=sum( aggr(FirstSortedValue({<YearMonth = {'2011 Dec'}, Month=,Year=,Date=>} Value, Sorted_Ind_From_The_Last_TimeStmp), ID, Name))

You can replace the hardcoded literals with dynamic values using e.g. dollar sign expansion.

I found also this series of blogs quite useful:

http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/

Maybe you could also use Month as additional dimension to your aggr() function and use Month also as dimension in your chart object and limit the dimension values to the two values you are interested in.

If you post some lines of sample data or a small sample app, I think someone here might help you out with the exact syntax.