Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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
Not applicable

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

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

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.

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Or in

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

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

paulcalvet
Partner - Specialist
Partner - Specialist
Author

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

Hi Jonathan,

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

paulcalvet
Partner - Specialist
Partner - Specialist
Author

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

Not applicable


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