Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to assign variable YTD values from 1 to 10. Goal is to use this variable in set expression, so it can have values 1 and 2 and 3 and so on. How to do it in code?
I tried something like this, but doesn't seem to work:
YTD='{'&1&2&3&4&5&6&7&8&9&10&'}'
Best
maasool
In set analysis, you could also use '<=' or '>=' instead of mentioning all individual numbers. Hence, you may try like:
=Sum({<MonthNum={"<=$(=vMaxMonth)"}>}Sales)
where your variable vMaxMonth would hold the maximum month number you want to sum the amount upto.
hi
why do you need more than one value in your variable
if the current value is 10 than your set expression can be {<something <= YOURVARIABLE >}
Hi!
To calculate YTD sales. Instead of updating master items, I could update only one variable defined in data load.
For example, in March, I would like to include sales for months 1,2,3. For October, I would like to include months 1,2,3,4,5,6,7,8,9 and 10.
Best
maasool
In set analysis, you could also use '<=' or '>=' instead of mentioning all individual numbers. Hence, you may try like:
=Sum({<MonthNum={"<=$(=vMaxMonth)"}>}Sales)
where your variable vMaxMonth would hold the maximum month number you want to sum the amount upto.
Thanks!
what would be the case if I wanted to do something similar but with actual dimension values vs numbers? For example - instead of sum of sales for months 1-10 what about sum of sales for the given product 'A','B','C', etc.
Post as new question with sample data and required output