Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a formula that looks like this:
($(vSalesTY) - $(vReturnsTY)) / ($(vNetTransactionsTY))
How do I add set analysis to this calculation?
All examples show Sum({< Set Analysis >} Expression) but if I add Sum to the calculation above, I seem to get an error?
Sum( {$<FinTxtMonth = {'$(MonthSelected)'} >} (($(vSalesTY) - $(vReturnsTY)) / ($(vNetTransactionsTY))))
If not, how do I use set analysis on the original expression
Hi,
what is the value of variables?
Regards.
What exactly are you trying to do with set analysis? What are you expecting as a result?
Set analysis works with summary functions (such as sum), where you want to filter your data a specific way before applying the summary function. Ie: give me the sum of the sales where the product = 'Apples'.
'applying' set analysis to an expression composed entirely of variables, or that does not use summary functions is meaningless. Variables aren't affected by set selections, and functions that don't summarize data are similarly not affected by set selection.
It's like asking: 'what is 24 divided by 6 for all sales where the product = apples' - it doesn't make sense.
If your variables contain pre-summarized data, then you'll need to apply the set analysis prior to setting the variable values.
I'm guessing each one of your variables holds a formula that calculates something, perhaps with sum() functions. Using the variables with the $()-expansions only helps replacing the variable name with the formula, but QlikView will still try and evaluate the whole expression together.
In order to use Set Analysis, you need to include your SA condition in each one of the expressions that are hiding behind the variables.
Thanks all for the replies. The variables each hold a calculation that I want to maintain, but in this specific graph an additional condition must be added. I hoped to keep the variable intact so that the same calculation is maintained in only one place, looks like this will not be possible.