# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for
Did you mean:
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)

Labels (1)
• ### Layout & Visualizations

2 Solutions

Accepted Solutions
Specialist II

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)

Contributor
Author

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

2 Replies
Specialist II

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)

Contributor
Author

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

Community Browser