Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
AH
Creator III
Creator III

Average Sales by category

Hi,

Could you please have a look at the qvw and let me know that why i am not getting the eaxct Average sales amount for SalesType-FT and Product-UV?

Really appreciate any kind of help.

Thanks,

Shan

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

=Sum({<Product={UV}, SalesType={FT}>} [Sales Amount])/Count({<Product={UV}, SalesType={FT}>}Distinct CustomerID)

Regards,

Jagan.

View solution in original post

9 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

=Sum({<Product={UV}, SalesType={FT}>} [Sales Amount])/Count({<Product={UV}, SalesType={FT}>}Distinct CustomerID)

Regards,

Jagan.

AH
Creator III
Creator III
Author

Thanks Jagan! Your expression works perfect.

Shan

AH
Creator III
Creator III
Author

Hi Jagan,

How i can calculate the Six Months Moving Average Sales for Product UV and Prodct FT in the Chart?

Thanks,

Shan

AH
Creator III
Creator III
Author

Hi Jagan,

Would it be the right expression if i want to calculate 6 months moving average?

=avg( aggr( rangesum( above( Sum({<SalesType={ST,SV}>} [TotalSalesAmount]),0,6) ),[Invoice Month]))

Thanks,

Shan

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you have a date field in your Data model then try below expression to get last 6 months sales

Sum({<YearDimension=, MonthDimension=, Date={'>=$(=MonthStart(Max(Date), -5))<=$(=MonthEnd(Max(Date)))'}, SalesType={ST,SV}>} [TotalSalesAmount])


Hope this helps you.


REgards,

Jagan.

AH
Creator III
Creator III
Author

Hi Jagan,

Tried with the expression. Not working.

Regards,

Shan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Attach same file and your expected output, I think may be the date format issue.

Regards,

Jagan.

AH
Creator III
Creator III
Author

Hi Jagan,

Please find attach file. Thanks for your quick response.

Regards,

Shan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=Sum({<[Inv Quarter]=, [Inv Week]=, [Inv Month], [Inv Year]=, InvDate={'>=$(=MonthStart(Max(InvDate), -5))<=$(=MonthEnd(Max(InvDate)))'}, SalesType={FT,SV}>} [Sales Amount])

Regards,

Jagan.