Discussion board where members can learn more about Qlik Sense App Development and Usage.
the need is :
- Get a flatten market share by summing the sales of the 2 previous months + the current one and dividing this amount by the Total sales of these 3 months.
Example: Total sales for Jan, Feb and Mar is 100. For a product the sales in Jan is 1, in Feb 3 and in Mar 2. The expected MS should be (1+3+2)/100 = 6% of Market Share on month March (flatten).
Would you get ideas about how to achieve this?
Thank you and regards,
not a nice solution, but maybe useful. For better performance you would need probable another approach (in case your data set is large)
LOAD RowNo() AS ID, * Inline [
num((ProductSales_3M/TotalSales_3M),'#,0%') AS %Market_Share
RangeSum(Sales,Previous(Sales),Previous(Previous(Sales))) as TotalSales_3M,
RangeSum(ProductSales,Previous(ProductSales),Previous(Previous(ProductSales))) as ProductSales_3M
Order by ID asc
DROP Table tmpTable;
Would you be able to share sample data?