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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find dimension value based on expression

Name , Type, Dress, Price

    V, Shirts, Full Sleeves, 210

    V, Shirts, Half Sleeves, 300

    V , Trousers, Jeans, 600

    J , Trousers, Jeans, 400

    J , Trousers, Formal, 350,-1

    J , Shirts, Half Sleeves, 500

    Vi, Shirts, Full Sleeves, 450

    Vi, Trousers, Formal, 400

I need  a chart which displays

V Trousers 600

J  Shirts,500

Vi Trousers,400

I need the type of dress purchased by each whose value is maximum

Can someone help me out with the expression for the straight table

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the FirstSortedValue for this. For getting the Type with the highest price for the name use Name as dimension and FirstSortedValue(Type,-Price) as expression. See attached example. BTW I get a different result than your example:

    J Shirts 500
    V Trousers 600
    Vi Shirts 450

talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the FirstSortedValue for this. For getting the Type with the highest price for the name use Name as dimension and FirstSortedValue(Type,-Price) as expression. See attached example. BTW I get a different result than your example:

    J Shirts 500
    V Trousers 600
    Vi Shirts 450

talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert,

That worked for me . Can we get similar result using the pivot table?I tried using a calculated dimension ,but didnt get the required.