Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
spjuza
Contributor III
Contributor III

KPI Chart not giving an option for Aggregation when creating KPI Chart, and not calculating correctly when using the expression creator

I am trying to create a KPI chart that will show the potential savings opportunity that exists.  I have created the master measure ("Potential Savings") that relies on another Master Measure ("Average Cost") and it's displaying correctly when I create a table.  

When I create a KPI chart and add it, I do not get an an option to add an aggregate function (Screenshot attached).  

spjuza_0-1639153316090.png

 

I read somewhere that nesting Master items can cause issues, so in the expression I just typed in the expression of the "Average Cost" master measure, but still no success. 

Lastly, I tried manually doing the Sum aggregation, but it says it cannot accept nested Aggregations.

 

1 Solution

Accepted Solutions
spjuza
Contributor III
Contributor III
Author

I solved this by calculating the necessary variable in the data load script.  The issue seemed to be because I was including a dimension in the measure calculation. 

View solution in original post

3 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Can you share the expression you are using ?

spjuza
Contributor III
Contributor III
Author

The master expression is this:

if(([Var3]<(Sum({$<[Var1]={">0"}>}[Var2])/sum({<[Var1]={">0"}>}[Var1]))),
(Sum({$<[Var1]={">0"}>}[Var2])/sum({<[Var1]={">0"}>}[Var1])
- [Var3]) * Var4,0)

 

The sum block is a separate measure, so I've also tried:

if(([Var3]<([Average Cost])),([Average Cost] - [Var3]) * Qty,0)

spjuza
Contributor III
Contributor III
Author

I solved this by calculating the necessary variable in the data load script.  The issue seemed to be because I was including a dimension in the measure calculation.