Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jjmartegarcia
Contributor II
Contributor II

Qlik sense variable calculation before expression evaluation fails.

Hello everyone, 

I have the following issue:

I want to use the numerical value of  a variable (as a constant) instead of the expression in a pivot table.

The expression for the variable in the variable editor is the following: =Sum({1<Jaar = P(), DateID={"TRANSDATE"}, [asset.htm_tramtype_description] ={"Avenio"},[asset.assettype]={"TRAM"}>}[meterreading.delta])

The pivot table has one dimension and looks like:

KnipselQlikVariable.PNG

The expression for the measure in the pivot table : 

$(vKM_Avenio)
/
count(distinct {<[workorder.worktype]={"STO"}>} workorder.wonum)

As you can see in the picture above,  in the pivot chart only null is displayed for the measure. The expression "count(distinct {<[workorder.worktype]={"STO"}>} workorder.wonum)" has an association with the dimension so this is not the cause. The expression underneath the variable vKM_Avenio does not have an association with the dimension, but since the variable has been defined with a preceeding "=" sign, I expected that this would work. 

What am I doing wrong here? Or is this just not possible with Qlik Sense?

Help is much appreciated!

Kind Regards, 

Junior

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

what about using the below expression:

vKM_Avenio
/
count(distinct {<[workorder.worktype]={"STO"}>} workorder.wonum)

?

View solution in original post

4 Replies
agigliotti
Partner - Champion
Partner - Champion

it seems the variable "vKM_Avenio" value is correct (18871758,50).
let's try using "count(distinct {<[workorder.worktype]={"STO"}>} workorder.wonum)" as expression in your pivot table to see what you get.

jjmartegarcia
Contributor II
Contributor II
Author

Hi Agigliotti, 

This is what I get:

KnipselQlikVariable2.PNG

Kind Regards, 

Junior

agigliotti
Partner - Champion
Partner - Champion

what about using the below expression:

vKM_Avenio
/
count(distinct {<[workorder.worktype]={"STO"}>} workorder.wonum)

?

jjmartegarcia
Contributor II
Contributor II
Author

Thanks Agigliotti!

This does the job.

I'm curious to know where you got this information from. This is what Qlik help explains.

Kind Regards, 

Junior