Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Returning a value of the max number in a table

I have a table with purchase data.

Now I only want to return the latest purchase price in a pivot table.

I made this function:

If((max(purchasenumber)= purchasenumber),purchase.purchaseprice_netto)

--> purchasenumber is the unique number of the purchasedocuments, so the highest number (max) is the latest document.

I get a "-" as result in my pivot table, when I select the latest purchasedocument in a selection box than it returns the correct value!

What am I doing wrong?

Labels (2)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Try using FirstSortedValue(), like:

FirstSortedValue(purchase.purchaseprice_netto, -purchasenumber)

View solution in original post

2 Replies
Highlighted
MVP
MVP

Try using FirstSortedValue(), like:

FirstSortedValue(purchase.purchaseprice_netto, -purchasenumber)

View solution in original post

Highlighted
Contributor
Contributor

Thx, this gives the correct value!