Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone...
I need to know if a product has been in sold 12 months before the month selected.
For example, my table is:
Product | Year&Month |
---|---|
1 | 201208 |
1 | 201209 |
1 | 201210 |
1 | 201211 |
1 | 201212 |
1 | 201301 |
1 | 201302 |
1 | 201303 |
1 | 201304 |
1 | 201305 |
1 | 201306 |
1 | 201307 |
In this situation if I choose the Year&Month 201307 the product 1 will have the count of 12 months before.
But in some case one month is not in the list, let say 201304 is not in the table, then I will have a count of 11 before if a select the Year&Month 201307.
Can I put this in a expression or script?
Thanks
Can you post an example QVW with the script in?
See attached qvw.
Hi gysbert...
Nice example, i think it will be ok with a modification.
how can I get filter the products that just have de 12 months consecutive before.
In other words, When I click the YearMonth just let the products that have the 12 months before in the table.
thanks
Try:
='Count: ' & count({<YearMonth=,Product={"=count({<YearMonth=,YMNo={'>=$(=max(YMNo)-12)<$(=max(YMNo))'}>}distinct YearMonth)=12"}>}distinct Product)