Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Jaeger
Contributor II
Contributor II

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