Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Lookup for Max Value in one column and based on this, calculate corresponding max value in another column

Here is my sample data.

ID Ver1 Ver2
24 1 1
24 1 2
24 2 1
24 2 2
24 3 1
24 3 2
24 4 1
24 4 2
24 5 1
24 5 2
24 6 1
19 1 1
20 1 1
20 1 2
20 1 3
20 2 1
20 2 2
21 1 1
21 1 2
21 2 1
21 2 2
21 3 1
21 3 2
21 4 1

 

I need to create a button action where when clicked should show rows with Max Ver1 and corresponding ver2 values.

 

Output:

 

ID Ver1 Ver2
24 6 1
19 1 1
20 2 2
21 4 1

 

 

Also, when I use ID as Dimension in Straight table and Ver1 and Ver2 as Expressions, I don't see values in Ver1 and Ver2 columns. But when I create a Table box, it shows all the data. How to fix this?

Labels (1)
11 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Perhaps the data coming in from the database is string instead of numeric?  Put the data in a Listbox, if it left aligns it's string (Text). Fix it by applying the Num#() function to the data s you load it.  

-Rob

qlikwiz123
Creator III
Creator III
Author

I thought so too. They are right aligned in the listbox. I even used the Num() to explicitly convert them to numbers but no luck. This works if I load the data from Excel or Inline Tables but not from the Database