Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis on variable

Hi,

I want to apply set analysis on a variable without separating it's components.

Var = sum(A)+sum(B)

v_Ignore_Some_selections={<DIVISION_NAME=,CC_NAME=>}


The only solution I found so far is the following:

sum($(v_Ignore_Some_selections)A)+sum($(v_Ignore_Some_selections)B)


but as I mentioned, I don't want to separate the variable components (because this way, when i change the variable i have to manually change it every place its appears)


Is it possible?

Thanks,

Nadav

5 Replies
sunny_talwar

I think what you are looking for isn't possible at least as per my knowledge.

Not applicable
Author

If it suits you can bring in a new field from script itself as summation of A and B.

Then ignore variable.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I don't understand your worry. Variables are used to not force you to apply changes in multiple places.

If you ever want to change the set analysis selections, you only have to modify the SET statement for variable v_Ignore_Some_selections.

If you ever want to change the expression result (by adding another Sum() or so), you only have to change the SET statement for variable Var.

Or am I missing something here?

marcus_sommer

I'm not sure what do you trying to do but maybe something like this is helpful:

v_Ignore_Some_selections: {<DIVISION_NAME=,CC_NAME=>}

vExp: sum($(v_Ignore_Some_selections) $1)

Var = rangesum($(vExp(A)),$(vExp(B)))


Variables

- Marcus

Not applicable
Author

Thanks Peter,

The variable i want to be able to change is (Var), not (v_Ignore_Some_selections).

Therefore,  if I have to write the expression explicitly (e.g- sum($(v_Ignore_Some_selections)A)+sum($(v_Ignore_Some_selections)B),

the change of the variable VAR won't affect this expression