Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

paulcalvet
Contributor

Variable in expression

Hi everybody,

I have a Qlikview 11 application with the variable V_IND_GEO 

='IND_$(=Only(TABLE_NOM_GEO))';

Then, in a chart, I have an expression like this :

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>} DISTINCT If($(V_IND_GEO) = IND_GEO, INDICATEUR_ACTIVITE)))

In Sense, i put variable in the script :

SET V_IND_GEO   ='IND_$(=Only(TABLE_NOM_GEO))';

And this expression in my chart :

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>} DISTINCT If($(V_IND_GEO) = IND_GEO, INDICATEUR_ACTIVITE))

When I select a value for TABLE_NOM_GEO, the expressions works in QV11 but not in Qlik Sense.

Is there a difference between QV11 and Sense with the variable ?

Thanks

Paul

13 Replies
Not applicable

Re: Variable in expression

Hi,

Can you try with :

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>} DISTINCT If($(V_IND_GEO) = $(IND_GEO), INDICATEUR_ACTIVITE))


You also can try with LET rather than SET.


Regards,

Xavier.

paulcalvet
Contributor

Re: Variable in expression

Bonjour Xavier,

Thanks, but this don't work (I try with let and set).

As you can see, the value of IND_GEO is not retrieve by QV.

QV var.png

Regards,

Paul

Not applicable

Re: Variable in expression

Bonjour Paul,

Can you try :

SET V_IND_GEO   ='IND_' & $(=Only(TABLE_NOM_GEO));

with your initial expression :

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>} DISTINCT If($(V_IND_GEO) = IND_GEO, INDICATEUR_ACTIVITE))

I think QlikSense doesn't evaluate correctly the nested $()

Regards,

Xavier.

MVP
MVP

Re: Variable in expression

SET V_IND_GEO = '=IND_$(=Only(TABLE_NOM_GEO))';

Not applicable

Re: Variable in expression

Or in

SET V_IND_GEO   ='IND_$(=Only(TABLE_NOM_GEO))';

$(=Only(TABLE_NOM_GEO) => Return a Null.

paulcalvet
Contributor

Re: Variable in expression

Hi Xavier,

Thanks again for yur help.

This expressions doesn't work.

Yes there is a big problem with variable as you can see below...

QV var.png

I've tried many combiantion, but none works !!

paulcalvet
Contributor

Re: Variable in expression

Hi Jonathan,

It doesn't work, this expression seems to return nothing QV var.png

paulcalvet
Contributor

Re: Variable in expression

No, it doesn't work.QV var.png

Not applicable

Re: Variable in expression


What is the value returned by : Only(TABLE_NOM_GEO) ?

Community Browser