Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, people!
For example
=sum( { ['Year_1_' & [Shop] ] } )
as
=sum({[Year_1_Shop1]} sales)
Year_1_Shop1 - it's name alter state
where shop it's field, and shop = shop1,
but shop2 will be =sum({[Year_1_Shop2]} sales)
How do it?
This kind of thing you can´t do
=sum({[$(='State_spec_'&[Dim1])]}Expression1)
Set analysis are not evaluated per row, it´s evaluated before the aggregation of the object, reducing the record set will be evaluated.
You can use a dolar expansion
=sum({$(=Year_1_Shop' & anothervar)} sales)
task to glue the name of an alternate state, the dollar is only one choice. Have you checked? 😃
Sorry, didn´t check it, but it works, please check attached
The expression: =Sum({[$(='AE'&vEstate)]}Expression1)
Do you expect your expression to consider the current chart dimension, i.e. Shop?
This won't work, since dollar sign expansion as well as set analysis is only evaluated once per chart, not per dimension line.
If this is the case, you would need to branch your expression based on dimension:
If(Shop = 'Shop1',
sum({Year_1_Shop1} sales),
If(Shop= 'Shop2', sum({Year_1_Shop2} sales) )
)
Not sure if this comes close to what you are trying to do. Please detail your requirements and setting / context.
Hi warfollowmy_verysoon,
You can calculate it on variable, on Set Analysis call variable.
Variable -> ='Year_1_' & MinString([Shop])
Set Analysis -> =sum({$(YourVarName)} Sales)
Or you can do it with Variable with parameter
Variable -> ='Year_1_' &$1
Set Analysis -> =sum({$(YourVarName('Shop2'))} Sales)
Thanks,
Nice, good to see that it works
Thank you, but the problem is not the point. The task dynamically generate alternative state the name of the column name is not IF function. I have attached an example of your in my first post.
Thanks, but no need to IF. On if there is already 😃