Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulcalvet
Partner - Specialist
Partner - Specialist

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
paulcalvet
Partner - Specialist
Partner - Specialist
Author

It returned the right value (the name of the indicateur wich is selected :QV var.png

Not applicable

Maybe it's because the Only() function is a graphical function (and V_IND_GEO is evaluated in the script).

Can you try with :

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>} DISTINCT If('IND_$(=Only(TABLE_NOM_GEO))' = IND_GEO, INDICATEUR_ACTIVITE))

Anonymous
Not applicable

Hi Paul,

Pls try this expression

Avg({$<ANNEE = {$(=Max(ANNEE))}, FINESS = P(FINESS)>}

  DISTINCT

    $(=if('$(=V_IND_GEO)' = 'IND_GEO', INDICATEUR_ACTIVITE)))

by setting the same variable like

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

Thanks,

Vignesh

paulcalvet
Partner - Specialist
Partner - Specialist
Author

Vignesh,

This is the result, this expression doesn't work :

QV var.png