Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show a value based on the max of another value

Hello,

I am new to Qlikview and having issues with something.  I am wanting to show a unit cost based on the last purchase date of a product/po.

We have a table that has po number, product code, po date, unit cost etc.  these are all individual lines in the table and what I want to do is show a new field as the last purchase cost based on the date and product code.

so if I have:

po number      product code     po date          unit cost

1                    product A          1/20/2016     50

2                    product A          2/20/2016     45

what I would want is:

po number     product code     po date          unit cost     last purchase cost

1                    product A          1/20/2016     50               45

1                    product A          2/20/2016     45               45

this is in a straight table.  Just curious if this can be done.

Thanks
Brandon

1 Solution

Accepted Solutions
sunny_talwar

May be this:

FirstSortedValue(TOTAL <[product code]> [unit cost], -[po date])

View solution in original post

2 Replies
sunny_talwar

May be this:

FirstSortedValue(TOTAL <[product code]> [unit cost], -[po date])

Anonymous
Not applicable
Author

That seems to have worked.  Thanks for the quick help.