# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
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
MVP

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))

7 Replies

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)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Creator
Author

i'm expecting

 C_FAMIGLIA_RIL min value of W_PRZ_PUBBL_FAM occurrences of min value 00A 0,69 2 00B 0,75 1

thanks

Master

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

I think 2 and 1 is the correct answer?

Creator
Author

yes

thanks

MVP

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))

Creator
Author

It works perfectly

thank you so much

MVP

No problem at all