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: 
Anonymous
Not applicable

How to get the previous and current rating for an employee

Employee_IDAppraisalToDateFinal_Rating
1006/1/20144
1016/1/20145
1026/1/20143
1036/1/20142
10012/1/20145
10112/1/20144
10212/1/20143
10312/1/20142
1006/1/20155
1016/1/20154
1026/1/20153
1036/1/20152
10012/1/20155
10112/1/20154
10212/1/20153
10312/1/20152

These are the data  i have my problem is i want to get the current rating and previous rating from final rating field based on the appraisalto date

below expression gives the current rating for each employee, but I did not get the previous rating,

Sum(If(Aggr(NODISTINCT MaxString(AppraisalToDate),Employee_ID) = AppraisalToDate, FinalRating))   

so,I need  how to get the previous and current rating from the above table

1 Solution

Accepted Solutions
maxgro
MVP
MVP

I think you can make a chart with

Employee_ID as dimension

and as expression

     FirstSortedValue(Final_Rating, -AppraisalToDate)

or for previous rating add the third parameter to FirstSortedValue function

     FirstSortedValue(Final_Rating, -AppraisalToDate, 2)



View solution in original post

8 Replies
sunny_talwar

Where are you trying to get this? Is AppraisalToDate is one of the dimensions?

maxgro
MVP
MVP

I think you can make a chart with

Employee_ID as dimension

and as expression

     FirstSortedValue(Final_Rating, -AppraisalToDate)

or for previous rating add the third parameter to FirstSortedValue function

     FirstSortedValue(Final_Rating, -AppraisalToDate, 2)



Anonymous
Not applicable
Author

I am trying to get two columns as previous rating and current rating from single fields named as "Final_Rating" for that another column need for checking the date I used as "AppraisalToDate" column. AppraisalToDate is not a dimension Both previous rating and current rating are used as measures.

Capture.PNG

sunny_talwar

I think maxgro‌'s solution is what you need

Anonymous
Not applicable
Author

thanks@maxgro 

yoganantha321
Creator II
Creator II

Whether the two fields can be used as columns in table

rajaqliks
Contributor III
Contributor III

sum({<AppraisalToDate={'6/1/2014'}>}Final_Rating);

sum({<AppraisalToDate={'12/1/2014'}>}Final_Rating);

sum({<AppraisalToDate={'6/1/2015'}>}Final_Rating);

sum({<AppraisalToDate={'12/1/2015'}>}Final_Rating);

try this, add in expression tab, i hope it works.

rajaqliks
Contributor III
Contributor III

its working but some problem is there if we can modify the date it will not working properly