Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Did you mean:
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 "-".

Vendor_id

DatePrice

V1

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

the maximum

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

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)

MVP

Contributor III
Author

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

And I got the right:

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.

Master

HI,

Try below expression

=Sum(Aggr(Sum({<Date=

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

Thanks,

Contributor III
Author

No it's not working

Master

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

Contributor III
Author

MVP

Hi, can you try?:

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

Community Browser