Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tim_m
Partner - Contributor III
Partner - Contributor III

Use a defined KPI in another KPI measure in master items?

Hi Folks,

I have defined two measures in master items. KPI A and KPI B.

KPI A is defined as following:

A =

long-term liabilities

+

short-term liabilities.

KPI B is defined as following:

B =

stocks

+

requirements.

I want to create KPI C:

C =

A

-

B.

The situation is, Qlik Sense gives an error message, when I edit formula C and put in A - B.

The only way so far is confusing and following:

C =

long-term liabilities

+

short-term liabilities

-

stocks

-

requirements.

I heard about the possibility of storing formulas in variables and using them in other formulas (in this case "C"). I'm at a loss, because the previous method is very confusing to create KPIs that use other KPIs.


Can someone give me a key word, which allows me to google?

Thanks a lot

Tim

1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi Tim

You can creat variable to store your mesure then call them as another mesure

Exemple

lets say A =

sum([long-term liabilities])

+

sum([short-term liabilities])

create a variable ( clic at the bottom left button )

Capture.PNG

then add your mesure in the variable editor

Capture.PNG

Do the same for mesure B

Now you can either create a KPI for C

add as mesure this

=$(A) + $(B)

dollar sign and parenthese are used to call variable

Or create a third variable

Same approch open the variable editor

name your variable as C for example and add as mesure this

=$(A) + $(B)

Then in a KPI just add $(C) as mesure

Hope it helps

PS see on YouTube

https://www.youtube.com/watch?v=uFT-PNf_z9g

View solution in original post

4 Replies
brunobertels
Master
Master

Hi Tim

You can creat variable to store your mesure then call them as another mesure

Exemple

lets say A =

sum([long-term liabilities])

+

sum([short-term liabilities])

create a variable ( clic at the bottom left button )

Capture.PNG

then add your mesure in the variable editor

Capture.PNG

Do the same for mesure B

Now you can either create a KPI for C

add as mesure this

=$(A) + $(B)

dollar sign and parenthese are used to call variable

Or create a third variable

Same approch open the variable editor

name your variable as C for example and add as mesure this

=$(A) + $(B)

Then in a KPI just add $(C) as mesure

Hope it helps

PS see on YouTube

https://www.youtube.com/watch?v=uFT-PNf_z9g

tim_m
Partner - Contributor III
Partner - Contributor III
Author

Hi Bruno,

thanks a lot for your responce. I tried that way.

I'm just wondering about the testimony of a colleague who said that the word code injection is what I should look for. Google said "Code Injection + Qlik zero hits"

brunobertels
Master
Master

Hi Tim

Not sure to understand what your collegue means by "word code injection"

in script editor you can type the first lettre of a dimension and Qlik propose a list of possible occurrence

The same is possible with variable , if you type the first letter of a variable name Qlik will give a list of possible variable name.

But for master mesure and dimension this is not possible.

Regards

Bruno

tim_m
Partner - Contributor III
Partner - Contributor III
Author

Hi Bruno,

Hm that sounds complicated. The first variant you have explained works.


Thank you.


Regards



Tim