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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pick up value of one column where another columns value is max

Hi there,
i'm trying to find a solution for the issue similar to the below one
i have two columns
A B
1 10
2 20
3 30
4 40
now i define another column C as A's value where B is maximum..
Like
now i wan't C's value to be 4
i'm trying to fix this using aggregaterow component. and filter
Please help me with this issue!
Thanks in adv.
Labels (2)
3 Replies
Anonymous
Not applicable
Author

Hi,
If I understand your requirement very well, for your use case is the expected result:
A B
1 10
2 20
3 30
4 40
The max value is 4?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Anugna,
Problem is interesting. I tried to make it bit difficult by changing the second column. Now my data is
A;B
1;10
2;5
3;30
4;20
And I want to display larger id is 3. Use tMemorizeRow component, set Row count to memorise for both columns to 2. Use tJavarow component and use the logic for identifying the maximum in Column B and set it to some context variable.
OnSubjobOk -- Print that context variable value.
See the attached screenshot for your reference.
Hope it helps
Thanks
Vaibhav
0683p000009MDJS.jpg 0683p000009MDLS.jpg
willm1
Creator
Creator

Or, if this is coming from a DB, you could very simply use the max analytic function(s) to do it... For example http://stackoverflow.com/questions/6198320/how-to-use-partition-by-or-max