Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created a variable 'vYTD' which equals the latest month of the current year (assume for example the number '7')
I'd like to write an expression such that I can automatically call up the previous month using set analysis so I'm hoping to get something like:
Sum({<Month={$(vYTD)-1}>}Sales)
This syntax does not seem to be working. Can someone advise? Thanks in advance.
Did you use an equals sign instead of that pound symbol?
Can you get the expression to work if you hardcode the answer?
If that doesn't work, you may need quotes around the 7 (if that is a string). Check the values of your month field, are you sure they are numerals?Sum({<Month={7}>}Sales)
Did you put it into a unlabelled expression? If your dollar sign expansion null or your entire expression?
You may need:
Sum({<Month={$(=Num(vMonth)-1)}>}Sales)
Try:
Sum({<Month={$(=vYTD)-1}>}Sales)
When working with dollar sign expansions, put your expression into a Table Chart without a label. When the chart is rendered, the label will be your expression with the dollar sign expansion evaluated. That can be very helpful when working with complicated expressions.
Sum({<Month={$(#vMonth)-1}>}Sales)
I used the exact syntax above but for some reason, my expression is coming out null. Any other suggestions? Thanks.
Did you use an equals sign instead of that pound symbol?
Can you get the expression to work if you hardcode the answer?
If that doesn't work, you may need quotes around the 7 (if that is a string). Check the values of your month field, are you sure they are numerals?Sum({<Month={7}>}Sales)
Did you put it into a unlabelled expression? If your dollar sign expansion null or your entire expression?
You may need:
Sum({<Month={$(=Num(vMonth)-1)}>}Sales)
Using the expression with 'Num' actually worked. It seems that the variables, although they were true numbers in the data were acting like text for some reason. Applying 'Num' (even to numbers) worked perfectly.
Thank you very much.