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: 
nishanthi_8
Creator
Creator

How to compare the same field values which differs but it has common primary key ?

Suppose if  I have,

primary_key   Name    some_value

101                XXX            A23

102                YYY            S56

103                ZZZ             T74

101                XXX            R88

Now  I need to update the changed value in the design part along with the old value in a pivot table. How to do so?

14 Replies
sunny_talwar

So what is your desired output for the sample you have provided above?

nishanthi_8
Creator
Creator
Author

that is i want to display the changed value.... for example in a pivot table old value is A23 and the new value is R88 but i couldnt do so using if condition. But the data resides in a single table

sunny_talwar

Are you trying to do this on the front end of the application?

nishanthi_8
Creator
Creator
Author

ya front end

sunny_talwar

Assuming you have a date field which determines which some_value is most recent you can try this kind of expression:

FirstSortedValue(DISTINCT some_value, -datefield)

nishanthi_8
Creator
Creator
Author

no there is no datefield so how to proceed ?

sunny_talwar

How do you intend to determine which one is recent and which one is old?

nishanthi_8
Creator
Creator
Author

I mean the some_value to be some grade value for example initially he may in grade 0 that is G0 and later on to G1 but there is no record of when he has been changed. but i am forced to display the change in grade level with the respective person  i.e, i need to display only the people whose grade level has been changed.

sunny_talwar

If it is always going to be increasing may be use MaxString() function

MaxString(some_value)