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

count occurrences of min value

Hi, i need help in qlikview document for calculating the count occurrences of min value in pivot chart

In the attached document for calculating the occurrences of the minimum price for C_FAMIGLIA_RIL field i use

sum( if( W_PRZ_PUBBL_FAM = Aggr( Min(W_PRZ_PUBBL_FAM) , C_FAMIGLIA_RIL) , 1 , 0))

but it is not working properly

can someone help me?

thanks

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Sum(Aggr(If(W_PRZ_PUBBL_FAM = Min(TOTAL <C_FAMIGLIA_RIL> W_PRZ_PUBBL_FAM), 1, 0), C_FAMIGLIA_RIL, C_NEGOZIO))


Capture.PNG

View solution in original post

7 Replies
Anil_Babu_Samineni

Are you expecting 2 for 00A and 0 for 00B, Or what

If yes, You can use this

=count({<W_PRZ_PUBBL_FAM = {'=$(Min(W_PRZ_PUBBL_FAM))'}>}C_FAMIGLIA_RIL)

If you are expecting 24, 5 then might Adam Solution Work

=count({<W_PRZ_PUBBL_FAM = {'=Min(W_PRZ_PUBBL_FAM)'}>}C_FAMIGLIA_RIL)

OR If you are expecting 1, 1 Then you can use DISTINCT

=count({<W_PRZ_PUBBL_FAM = {'=$(Min(W_PRZ_PUBBL_FAM))'}>} DISTINCT C_FAMIGLIA_RIL)


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paolojolly
Creator
Creator
Author

i'm expecting

   

C_FAMIGLIA_RILmin value of W_PRZ_PUBBL_FAM
occurrences of min value
00A0,692
00B0,75

1

thanks

adamdavi3s
Master
Master

I deleted my answer as looking at the data it was not correct.

I think 2 and 1 is the correct answer?

paolojolly
Creator
Creator
Author

yes

thanks

sunny_talwar

May be this:

=Sum(Aggr(If(W_PRZ_PUBBL_FAM = Min(TOTAL <C_FAMIGLIA_RIL> W_PRZ_PUBBL_FAM), 1, 0), C_FAMIGLIA_RIL, C_NEGOZIO))


Capture.PNG

paolojolly
Creator
Creator
Author

It works perfectly

thank you so much

sunny_talwar

No problem at all