Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

min value different in kpi and table

Hi.

So I'm using the expression 

min(aggr(count (id), [associate_id]))

in two tables.

Table 1 has the associate ids and the expression next to it.   The totals set to min show the result "1".

When I use a Table 2 and I apply the exact same  expression alone, it returns that the min is "0".

The correct answer cross checked with SQL is "1". But how do I isolate that? 

 

What is happening? I was planning to use this min as a KPI.

 

 

1 Solution

Accepted Solutions
sunny_talwar

This just means that are there any nulls in associate ids? I mean one way to remove null associate ids would be to use this expression

Min({<[associate_id] *= {"*"}>} Aggr(Count(id), [associate_id]))

 

View solution in original post

22 Replies
sunny_talwar

Table2 doesn't have any dimension? Also, what do you see when you use the above expression in a kpi object?

ioannagr
Creator III
Creator III
Author

i used table2 just for the purspose of testing, could be a kpi as well so yeah it doesn't have any dimensions.

 

The same expression used in table 1 and kpi yields 1 and 0 respectively.

sunny_talwar

You mentioned that Table 1 contains associate_id as your dimension... are you seeing 1 for the total? Just want to make sure I have all the information

ioannagr
Creator III
Creator III
Author

This is what I'm seeing. Here's all the info you need 🙂

 

Also observe how for MAX value the results are the same.

 

 

sunny_talwar

Since the max is working, I see no reason why min is not working unless you have suppressed 0 values in your chart or you have suppressed some values in your dimension?

ioannagr
Creator III
Creator III
Author

I did nothing with the dimension 

and I checked that in data handling,  "include zero values" is ON. 

What is happening  😦😂

sunny_talwar

Can you try this in a KPI object

Concat(Aggr([associate_id] & ': ' & count (id), [associate_id]), ', ')

and do you see any associate_id: 0? in there? May be post a screenshot

ioannagr
Creator III
Creator III
Author

No i don't but then again I can't see all of them. 

sunny_talwar

Alright let's try make it more restrictive

Concat({<[associate_id] = {"=Count(id) = 0"}>} Aggr([associate_id] & ': ' & count (id), [associate_id]), ', ')