Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Search Max Date Sales

Hi folks!

   Recently i receive one solicitation, the solicitation is create a sales product no sales, and take the respective last date of sales, this mean, search in may database the max data of sale, product by product. Easy, just make a max(datasale) in SLQ and catch...Is not too simples, because a have group by in a all movement product table, of two year, this delay a lot. So i did this, i load all sales in qlikview and manage a column insed pivot table, make MAXSTRING(DateSale), ok...work it, but soon after a have catch de cost sales that product in the max datasale, and i not get, anyway, because a column Max(DateSales) in not a dimension.

How a make to get this.

sum(if(DataSale = Max(DataSales),CostSale))  ??

Sample below.

Sorry by my english!!!

Thank you!

1 Solution

Accepted Solutions
sunny_talwar

Try this:

FirstSortedValue(COSTSALES, -DATASALES)


Capture.PNG

View solution in original post

2 Replies
sunny_talwar

Try this:

FirstSortedValue(COSTSALES, -DATASALES)


Capture.PNG

Anonymous
Not applicable
Author

Very good man ... thanks thanks .

I research about FirstSortedValue understad and how it work ... The next time i will make by myself  =D !

Thank you again ... !!!!