6 Replies Latest reply: Dec 3, 2015 9:05 AM by Ruslans KLimovs

# Local variables

I have quiet a big report and many tables within it.

In each table I use similar formulas .. like this:

IF (

SUM(if((Sale_Category = 1.1 OR Sale_Category = 1.2), Sale_Money, 0))

/

SUM(if((Budget_Category = 1.1 OR Budget_Category = 1.2), Budget_Money, 0))

< Water_C2,

Is it possible to define formula  s ONE local variable ... like CHECK =.... ???

SUM(if((Sale_Category = 1.1 OR Sale_Category = 1.2), Sale_Money, 0))

/

SUM(if((Budget_Category = 1.1 OR Budget_Category = 1.2), Budget_Money, 0))

a

I can't do it in Settings-Variables (global), because it will not take local filters into account during the calculation.

• ###### Re: Local variables

You can use customized Measure as a local variable,

like this:

• ###### Re: Local variables

Sorry, didn't get it.

I use expressions in simple Table charts. I don't have any X or Y axis.

I just need to replace big formula ... to be like this

IF ( CHECK< Water_C2), ...

• ###### Re: Local variables

Simply add the variable CHECK in the variable overview to be:

CHECK:

SUM(if((Sale_Category = 1.1 OR Sale_Category = 1.2), Sale_Money, 0))

/

SUM(if((Budget_Category = 1.1 OR Budget_Category = 1.2), Budget_Money, 0))

If((\$(Check)) < Water_C2),...

• ###### Re: Local variables

I can't do this. In this case, it will be GLOBAL variable and it will not take into account local filters in my Chart Tables.

• ###### Re: Local variables

Can you please provide easy answer, how to use the variable in Charts expressions, which was defined in Qlick sense?

I defined my variable Let VarialbeX = Today()  ... where I have to define within qlick sense.

But, the system doesn't recognize VariableX within Charts expression.