Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
kolov007
Contributor III
Contributor III

Determination of the average price for the maximum date

Hello

I need to determine the average price of the product to the maximum (last) date of purchase of each product. And at the exit to get a table: Product, max(date), price. If it is a hard task, is it possible to make at least the following table: product, price

Screenshot_2.png

Help please, I will be very grateful

1 Solution

Accepted Solutions
swuehl
MVP
MVP

For max date, use an expression

=Max(Date)

and for average price on that date:

=FirstSortedValue(Aggr(Avg(Price),Product, Date) , Aggr(-Date,Product,Date))

View solution in original post

3 Replies
swuehl
MVP
MVP

For max date, use an expression

=Max(Date)

and for average price on that date:

=FirstSortedValue(Aggr(Avg(Price),Product, Date) , Aggr(-Date,Product,Date))

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Have a look at the application.

It is not possible in chart because chart will find the max at overall level, but not at dimension level.

I have done some changes in script and then its done.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi,

Are you expecting the below value?

use avg(Price)

-Sathish