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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
SrideviAyyala
Partner - Contributor
Partner - Contributor

How to compare two firstsortedvalue and get count, percent

Hi All,

I am new to Qlik Sense. I'm currently working on a chart which represents the comparision between the current & previous scores.

I got the Current & Previous Score values using FirstSortedValue function &  and commented them accordingly

Current Score = FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date)

Previous Score = FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date,2)

Comment = If(FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date) > FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date,2), 'Better',
If(FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date) < FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date,2), 'Worse',
IF(FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date) = FirstSortedValue([Likelihood to Recommend Score], -Customer_Response_Date,2), 'Same')))

Now I'm trying to calculate the below.

1. Get the Percentage of  Current Score > Previous Score(Better%), Current Score < Previous Score(Worse%) and Current Score = Previous Score(Same%).

Below is the Example Data:

CommentCustomer Response DateCurrent LTR ScorePrevious LTR Score
Worse11/12/201958
Worse09/12/201968
Worse03/12/201978
Worse18/12/201978
Worse25/11/201989
Worse14/08/201978
Same21/05/201977
Same04/10/20191010
Same02/10/201999
Same21/11/201977
Same06/08/201911
Same05/12/201988
Same07/05/201999
Same13/08/201999
Same09/08/201988
Same18/12/201988
Same03/12/201999
Same03/09/20191010
Same08/11/201988
Better01/10/201998
Better11/12/201987
Better11/12/201976
Better05/12/201976
Better19/08/201986
Better20/08/201995
Better06/08/201986

Could anyone help me with the calculation.

Appreciate your help.

Labels (1)
0 Replies