Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor II

How to display product with one price which is the newest one with the earliest date

Hi Guys,

I have a table like the following

VendorProductNet PriceValid From
AProduct 1

110

9/10/2017
AProduct 111024/6/2017
AProduct 111012/4/2017
AProduct 110416/12/2016
AProduct 110421/4/2016
BProduct 110510/10/2017
BProduct 11058/9/2017
AProduct 21037/7/2017
AProduct 21017/6/2017
BProduct 21025/6/2017
BProduct 21023/2/2017

Now what i want is to find the latest price of Product by Vendor but with the earliest Date.

VendorProductNet PriceValid From
AProduct 111012/4/2017
BProduct 11058/9/2017
AProduct 21037/7/2017
BProduct 21023/2/2017

I used firstsortedvalue to get the latest price.

My expression is FirstSortedValue([Net price],-[Valid From])

It gives the correct latest net price, but i could not able to Get earliest Date.


Any Ideas ?


Thank you so much in advance.

2 Replies
Highlighted
Honored Contributor III

Re: How to display product with one price which is the newest one with the earliest date

May be this

Highlighted
New Contributor II

Re: How to display product with one price which is the newest one with the earliest date

Max[Valid From] will give the maximum date but i want the earliest date in which there is max. price