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

One Star

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.
Moderator

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

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
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

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

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
One Star

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

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