3 Replies Latest reply: Mar 2, 2016 7:05 AM by Marcus Sommer

# Set Analysis

Hi There

I need to sum a variable and use set analysis to specify the parameters to sum of that variable...

Is it possible to use Set analysis like below??? or something like it... when doing it the way I have I just get the full sum of the variable it is disregarding the set analysis which I have specified.

vGrossProfit= Sum(Sales)-Sum([Cost of Sales])

vShop1GrossProfit=Sum({<Division={'Shop1'}>}vGrossProfit)

Sum({<Desk={'Desk1'}>}vShop1GrossProfit)

Thank You

• ###### Re: Set Analysis

Unfortunately, the 2nd and 3rd expressions are not going to work like this

• ###### Re: Set Analysis

Would I have to do the set analysis for each scenario 1st and then create the variables?

• ###### Re: Set Analysis

I don't understand how your approach could simplify (main reason for using variables) anything. Would it not easier to use something like this:

Sum({<Division={'Shop1'}, Desk={'Desk1'}>} Sales)-Sum({<Division={'Shop1'}, Desk={'Desk1'}>} [Cost of Sales])

or

var:

Sum({<Division={'Shop1'}, Desk={'Desk1'}>} \$1)

and then

\$(var(Sales)) - \$(var([Cost of Sales]))

- Marcus