Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Your calculations are being done in variables, not in the chart expression; therefore they are not being aggregated by the dimension automatically.
You need to change your vMaxNet and vMaxCost variables (and who knows how many others).
vMaxNet would be somthing like:
aggr(Sum({<Year={$(vMaxYear)}>} UnitPrice * Quantity *(1-Discount)),Country)
when the NewGroup selected field is Country.
You can probably replace Country in the expression above with GetCurrentField("New Group")
I can see that the variable declaration is wrong. For Example
vMaxMargin
SUM({<Year = {'$(vMaxYear)'}>}Quantity * UnitPrice * (1-Discount)) - SUM({<Year = {'$(vMaxYear)'}>}Quantity * UnitCost)
vMaxCost
SUM({<Year = {'$(vMaxYear)'}>}Quantity * UnitCost)
vMaxNet
SUM({<Year = {'$(vMaxYear)'}>}Quantity * UnitPrice * (1-Discount))
Similarly use below for previous year.
SUM({<Year = {'$(vPreYear)'}>}Quantity * UnitPrice * (1-Discount)) - SUM({<Year = {'$(vPreYear)'}>}Quantity * UnitCost)
I can't go each and every variables, so better to implement above suggested variables first and try to implement other accordingly..
Why cant i call "New Group" in set analysis...!!
Hi venkat,
You got the same result for Margin because those variables declares with "=" (equal sign).
Remove it from variable declaration and check attached result.
Hope this helps you.
Regards,
Andrei Kaliahin