Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Manju11
Contributor
Contributor

Compare two months (Current vs Prior Month)

I have a data which contains 'Months' of Vehicle for all 5 months (see example below). I also have a process month to select current month in my dashboard. Whenever a user selects a 'month', I intend to show a difference of '+/- Prior Month ' between for the month selected ('current month') and month prior to it ('prior month'). 

Table:  i want data in negative values for prior month  and  % prior month  i want compare current month with prior month (may nd april)

vehicle       Jan         Feb       mar       april      may      +/- prior month ,   % prior Month 

A                    10             20      30          40            30                 -10                               75%

B                       5             8       10          15             10                 -5                                  66%   

c                        6             7      10          15              8                    -7                                   53%

 

calculation:    30 - 40 =   -10 is   +/- prior month 

                           30/40*100  =   75%   % prior month           

i used to show monthly each month data as exp is 

=Sum({$<Type={'Sales'},Date=, Process Month={'may '}>}Volume)

 

Please advice .Thanks             

 

 

 

Labels (1)
2 Solutions

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Supposing the Month and Process Month are linked, I'd convert the Month Name to a Number

Num(Month(Date#(Month, 'MMMM'))) as [Process Month]

And then

+/- Prior Month

Sum({$<Type={'Sales'},Date=,[Process Month]={"$(=max([Process Month]))"}>}Volume)

-

Sum({$<Type={'Sales'},Date=,[Process Month]={"$(=max([Process Month]-1))"}>}Volume)

 

 

View solution in original post

Manju11
Contributor
Contributor
Author

Thanks for your reply, it didn't work. It also returns Zero values.

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Supposing the Month and Process Month are linked, I'd convert the Month Name to a Number

Num(Month(Date#(Month, 'MMMM'))) as [Process Month]

And then

+/- Prior Month

Sum({$<Type={'Sales'},Date=,[Process Month]={"$(=max([Process Month]))"}>}Volume)

-

Sum({$<Type={'Sales'},Date=,[Process Month]={"$(=max([Process Month]-1))"}>}Volume)

 

 

Manju11
Contributor
Contributor
Author

Thanks for your reply, it didn't work. It also returns Zero values.