Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator III
Creator III

percentage difference

Hi All,


I want to find percentage difference between 2 percentages.

So, in 3rd expression i want to show difference(comparing current and previous month percentages). Also, If the MaxMonth has more than 5% decrease compared to previous month then i want to show the 3rd expression in green background.


expr1-     sum({<MonthYear = {"$(vMaxMonth)"}>}Margin)/sum({<MonthYear = {"$(vMaxMonth)"}>}Sales)

expr2-     sum({<MonthYear = {"$(vPreMonth)"}>}Margin)/sum({<MonthYear = {"$(vPreMonth)"}>}Sales)

expr3-     Column(1) - Column(2)

Please help.

1 Solution

Accepted Solutions
sunny_talwar

4 Replies
sunny_talwar

You want this?

Capture.PNG

surajap123
Creator III
Creator III
Author

Sorry, attached wrong app earlier.

Hi Sunny,

Thank you so much for the solution.

I have a query. If i format the 1st and 2nd expressions with num() function(and disabled percentage checkbox in number tab), then i see the 3rd expression is not working.

eg-

num(sum({<MonthYear = {"$(vMaxMonth)"}>}Margin)/sum({<MonthYear = {"$(vMaxMonth)"}>}Sales)*100,'0.00%')


!Could you please help.

sunny_talwar

I guess what exactly would you want to see? Remove percentage from the number's tab to see this

Capture.PNG

Is there a reason you are formatting using Num() function rather than using the number's tab?

surajap123
Creator III
Creator III
Author

Thanks for the clarification.:)

I was trying various ways to understand the behaviour.