Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
RishabhTFC
Contributor III
Contributor III

Want to find the price of latest date or recent date

Hello Guys,

I want to make a bar graph that shows the price of vendors on the latest date.

this is the given sample to try. I tried firstsortedvalue function but it only shows valut of only V1 all others vendors are showing "-".

Please help me to solve this issue. 

Vendor_id

DatePrice

V1

20140601155
V120151001158.56
V12018010193
V220100501171.43
V320110718121
V22017050155
V120110718118
10 Replies
Chanty4u
MVP
MVP

the maximum

  1. Sum(Aggr(FirstSortedValue(Price, -Date), Vendor_id)) 
rubenmarin

Hi Subham, firstsortedvalue() should work, unles a vendor has many different values for the first or last date.

Last value: FirstSortedValue(Price, -Date)

First value: FirstSortedValue(Price, Date)

Chanty4u
MVP
MVP

Please close the thread if you got the correct answer

RishabhTFC
Contributor III
Contributor III
Author

Thank you very much, IT works perfectly. but there is one problem too. This is my Table

Screenshot (3).png

And I got the right:

     Capture.PNG

But the problem is I want to make a KPI and want to make some operations with that number "62.61"  (The sum of all the price of all the  Part_id of that vendor) I want it to multiply Quantity(Qty) with that 62.61 and show it in a KPI. 

sasikanth
Master
Master

HI,

Try below expression

=Sum(Aggr(Sum({<Date=

{$(=concat(chr(39)&aggr(distincmax(num(Date)),Vendor_id)&chr(39),','))}>}Price),Vendor_id))




Thanks,

RishabhTFC
Contributor III
Contributor III
Author

No it's not working

Screenshot (4).pngScreenshot (5).png

sasikanth
Master
Master

Check the expression once there is a space between Distinct  & max

RishabhTFC
Contributor III
Contributor III
Author

Screenshot (9).pngScreenshot (8).png

rubenmarin

Hi, can you try?:

Sum(Aggr(FirstSortedValue(Price, -Date), V_id, Part_id))*Sum(Qty)