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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to set analysis in YTM with calculation

Hi all,

I have a requirement on calculating the YTM of (the sales Quantity of a Product/the sales quantity if the shop has the Product A)

MonthProductShopSales Quantity
1AS12
1AS23
1BS15
2BS22
2BS11
2AS21
3BS13
3AS21
3BS17

For example, the Product = A,then the result:

Month 1:

(2+3)/(2+3+5)=0.5

Month 2:

1/1+2=0.5

Month 3:

1/1 =1

YTM = 0.5+0.5+1 =2 

How to use expression to calculate above scenario?

Sum({<Product = {"A"},[Month] = {"<=$(=Num(Month(monthstart(max(Month)))))"} >}[Sales Quantity])

  /

Sum({<Shop = p({1<Product = {'A'}>}Shop),[Month] = {"<=$(=Num(Month(monthstart(max(Month)))))"}>} [Sales Quantity])

The expression in above is incorrect.

The result will be:

2+3+1+1/2+3+5+2+1+1+3+1+7

Best Regards,

Louis

10 Replies
Anonymous
Not applicable
Author

Thank you very much!

I will make it asap.

Many Thx!