Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
chrisbrown1
Contributor III
Contributor III

FirstSortedValue()

I have the following table:
FirstSortedValue.PNG

I want to create another table that will only have the circled row.

I have Customer for my dimension. My minimum unit price by customer is: =Aggr(Min(UnitPrice), Customer)  which gives me:

FirstSortedValue2.PNG

How do I add the Product and UnitSales to this table and how do I get the FirstSortedValue so that I only get the Customer, Product, UnitSales and UnitPrice for that one row?

 

Labels (1)
1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Did you try like in your expression

=Firstsortedvalue(Product, Aggr(Min(UnitPrice), Customer)
=Firstsortedvalue(UnitSales, Aggr(Min(UnitPrice), Customer)
=Firstsortedvalue(UnitPrice, Aggr(Min(UnitPrice), Customer)

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

Why dont you sent a limit on the dimension to show bottom 1 value

pradosh_thakur
Master II
Master II

Try the below

I have wriiten the expression such that it will fetch the row that has lowest unitprice

min({<Customer={"=min(UnitPrice)=min( TOTAL  aggr( min(UnitPrice),Customer))"}>}UnitPrice)

The expression could be simpler i guess.

Learning never stops.
vishsaggi
Champion III
Champion III

Did you try like in your expression

=Firstsortedvalue(Product, Aggr(Min(UnitPrice), Customer)
=Firstsortedvalue(UnitSales, Aggr(Min(UnitPrice), Customer)
=Firstsortedvalue(UnitPrice, Aggr(Min(UnitPrice), Customer)
chrisbrown1
Contributor III
Contributor III
Author

Thank you Vishsaggi.