Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
matheus_silva
Contributor

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

Re: Search Max Date Sales

Try this:

FirstSortedValue(COSTSALES, -DATASALES)


Capture.PNG

2 Replies

Re: Search Max Date Sales

Try this:

FirstSortedValue(COSTSALES, -DATASALES)


Capture.PNG

matheus_silva
Contributor

Re: Search Max Date Sales

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 ... !!!!

Community Browser