Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello I'm new with QLik so sorry if the question is dumb.
I am making a report where I have several graphs with some quantity which depends on a filter selection.
I have a filter called "Machines" and then I have three different prices based on the machine name.
What I do is put a measure like this:
If(Machines='Ab042', SUM(price_ab),
if(Machines='Xr330', SUM(price_xr),
if(Machines='JJ8',SUM(price_jj))))
and anytime I have to make the same script.
Before QLik I used to work with Tableau where you can make a custom measure that, for instance, I would call "machine_price" which would be something like
machine_price =
If(Machines='Ab042', SUM(price_ab),
if(Machines='Xr330', SUM(price_xr),
if(Machines='JJ8',SUM(price_jj))))
so anytime I make a graph I can just put into the Measure field the value of machine_price.
I was wondering: is it possible to do something similar with QLik?
Hi
You can store the measure in the variables and re-use it.
Creating a variable ‒ Qlik Sense on Windows
Using variables in expressions ‒ Qlik Sense on Windows
Hope it helps you
create a variable
vPriceField =pick(wildmatch(Machines,'Ab042','Xr330','JJ8'),'price_ab','price_xr','price_jj')
in chart use Measure as below
=sum($(vPriceField ))