Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Make a KPI with values

Hey there,

I got a problem on making a KPI. I want to show a KPI which shows a count how many distinct BBDs (Best Before Date) (see table below) are higher than 1. So in the case from the table below it should display 6, because the count higher than 1 is 6.

I tried to make a count(if(count( formula but it al did not give me the right KPI. I run into the problem that I can't use the BBD in the formula, because this is a distinct count value I am making from more BBDs. So $$Prinartsubnr is a dimension and BBD a distinct count from all BBDs, making it a value and which makes it unusable for my KPI (in my opinion)

I have tried to make some sort of formula in my load too, but I couldn't.

  

$$PrinartsubnrBBD
6000|4031289|1-1276
6000|4055368|1-56008146945
6000|4045796|1-3604283
6000|4055368|1-180004793
6090|0340029968|1-1806032
6090|0340034411|1-823B92VT142
6000|20995|1-80036906581
6000|20995|1-80037061991
6000|22714|1-L81631
6000|22714|1-L81661

I am still learning a lot in Qlik and hope you can help me out or send me in the right direction. At the moment I am really stuck on this one.

Thanks in advance,

Paul.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Sasi,

You came really close to the right answer! I changed sum( to count( and that gave me the right result! Thanks a lot!!!!!!!!!

Right formula:

=count(Aggr(Count({<$$Prinartsubnr ={"=count(Distinct BBD)>1" }>} Distinct BBD ),$$Prinartsubnr ) )


Thanks again! Everyone thanks again for help! This got me really excited!

View solution in original post

14 Replies
pooja_prabhu_n
Creator III
Creator III

Hi,

You can restrict in dimension limits to show BBDs which are higher than 1.

KPI.PNG

thevingo
Creator
Creator

Hi

Sorry, I cant understand your question properly

Do you want to show it in Table or textbox

Do you want to show max value then use Aggr(Max(..

Anonymous
Not applicable
Author

Hi Pooja,

Thanks for your tip, it helped me out in a way and gave me new insights, but it is not what I am looking for.

See the image below, I count(distinct BBD) combined with $$Prinartsubnr (THTCheck1 in this image) and then I want to count the amount of lines. In this case 100 lines are open with distinct BBD > 1 (as shown in totalen=totals in english)(I could not have done that without your help, it actually gave me the right amount I was looking for, but not on the right spot).

Now I want to make a KPI showing 100, but I can't make the formula right to display this number as it does not allow me to add a dimension and measure together in this KPI. When I just do count(Distinct BBD) is gives me a higher number than it should, as it does not combined with $$Prinartsubnr. a formula like count(if(count does not allow me to combine $$Prinartsubnr and BBD to come to a total of 100.

Bottomline: I want a KPI displaying 100 and when lines get removed or added I want this KPI to react with in- or decrease.

Anonymous
Not applicable
Author

Hi Govind,

A KPI or a variable textbox would also work.

See my reaction to Pooja Nagaraj, maybe that explains better what I want is a result..

sasikanth
Master
Master

HI,

Could you please tell us the formula to calculates BBDs ??

Anonymous
Not applicable
Author

Best Before Date (BBD) is a dimension and I use count(distinct [BBD]) to come to the results in my table.

So for every $$Prinartsubnr it displays the amount of different BBD's, which makes it an value. Thats is why I have a hard time finishing this one I think, because BBD becomes a value instead of a dimension.

sasikanth
Master
Master

Try this,

=Sum(Aggr(Count( Distinct BBD ),$$Prinartsubnr ) )

Anonymous
Not applicable
Author

Hi Sasi,

I tried this, but it returns 4,21K as value. This is way too much as it should only be like 100 as shown in previous images and descriptions.

Think I will have to use a set analysis to come to the right result, but so far I couldn´t figure one out.

The hardest part is combining the distinct BBD when it is higher than 1 with the dimension $$prinartsubnr.

sasikanth
Master
Master

Could you please share your application