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

first ordered value

Hi,

I am trying to figure out a way to calculate the average daily sales per retail and then return the retail that has the highest daily average.

Below is an exemple of raw data followed by the expected result

Result

ModelRetail
A100
B200

 

Raw

DateModelRetailSales
1/1/2020A10050000
1/1/2020B20010000
1/2/2020A10058000
1/2/2020B20019000
1/3/2020A11035000
1/3/2020B22010000
1/4/2020A11525000
1/4/2020B2158500
1/5/2020A14015000
1/5/2020B2403000
Labels (2)
3 Replies
Taoufiq_Zarra

can you share more Raw Sample Data  to verify ? do you still have 2 lines per day ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
dominic_marchan
Contributor III
Contributor III
Author

Hi,

No the data is made up, simply for a proof of concept. If you require more data you can create dummy data in excel. 

There could be more than 2 models per day.

 

Thanks

Vinn_Qlik
Contributor II
Contributor II

Hi ,

Could you please try this way,

In straight table,take Model as Dimension and  Retail as Measure  exp:(=FirstSortedValue(Retail,-Sales))

Now under sorting section - Model - sort by expression (=sum(Sales)/Count({<Retail={*},Model={*}>}distinct Date)) and select descending .

Hope it helps!

Regards,

Ravi