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: 
Jaeger
Contributor III
Contributor III

Custom function

Hello,
I want to use a description depending on a seleted value of a Variable input in a chart.
Is it possible to create custom functions in Qlik Sense.
I tried to put the formula in a variable like this
vKpiDesc =if($1='kpiSales','Sales €','Costs €')
and use vKpiDesc($(vKpi1)) in the description property of the chart.
But that doesn't seem to work.
Even if I put =if($(vKpi1)='kpiSales','Sales €','Costs €') directly into the description property of the chart it always shows the else-part of the if statement.
Any idea?

1 Reply
Anonymous
Not applicable

 

You dollar-expand the variable vKpi1 too often when you hand it over as $1 parameter.

 

Here how it works:

Variable definitionVariable definition

 

And then hand over the variable vKpi1 without a dollar expansion: =$(vKpiDesc(vKpi1))

 

vardef2.png

 

Best regards,

Roland