Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a table like the following
Vendor | Product | Net Price | Valid From |
---|---|---|---|
A | Product 1 | 110 | 9/10/2017 |
A | Product 1 | 110 | 24/6/2017 |
A | Product 1 | 110 | 12/4/2017 |
A | Product 1 | 104 | 16/12/2016 |
A | Product 1 | 104 | 21/4/2016 |
B | Product 1 | 105 | 10/10/2017 |
B | Product 1 | 105 | 8/9/2017 |
A | Product 2 | 103 | 7/7/2017 |
A | Product 2 | 101 | 7/6/2017 |
B | Product 2 | 102 | 5/6/2017 |
B | Product 2 | 102 | 3/2/2017 |
Now what i want is to find the latest price of Product by Vendor but with the earliest Date.
Vendor | Product | Net Price | Valid From |
---|---|---|---|
A | Product 1 | 110 | 12/4/2017 |
B | Product 1 | 105 | 8/9/2017 |
A | Product 2 | 103 | 7/7/2017 |
B | Product 2 | 102 | 3/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.
May be this
Max[Valid From] will give the maximum date but i want the earliest date in which there is max. price