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

Count on sum

Hello,

i need your help to calculate a value.

So,this is my dataset

 

COD PERSONCOD ANIMALCATEGORYAMOUNT
A2CAT27655,8
A3CAT21064,02
B5CAT322
B6CAT35000
C7CAT130
C8CAT550

 

I want to the take, for every "COD PERSON" that have two different "COD ANIMAL" ,the row that have Amount, for each row, <=5000.

So in my table is expected to have

 

C7CAT130
C8CAT550

how can i do?? I need to calculate this in frontend

4 Replies
rubenmarin

Hi Khawar, you can try with:

Sum({<[COD PERSON]={"=Count(Distinct [COD ANIMAL])=2"}, AMOUNT={"<=5000"}>} AMOUNT)

Change "=2" to ">1" for "more than 1 different animal" instead of "two different animals"

uacg0009
Partner - Specialist
Partner - Specialist

Hi Khawar,

Hope below is what you want.

Count on sum.PNG

Thanks.

Aiolos

Anonymous
Not applicable
Author

uacg0009,

your qvw is correct!!!

can you explain me, how it work "Aggr(NODISTINCT " ?


thx

uacg0009
Partner - Specialist
Partner - Specialist

Hi Khawar,

The Aggr function is just like a group by in the front-end.

And add "nodistinct" means for every group, the expression will calculate a value.

I think you can try to create some table and value to try to use it

or you can find some other examples to see.

Hope I have clarified the aggr nodistinct.

Please make my answer to "correct" status, so other person will know the thread is finished.

Thanks.

Aiolos