Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count distinct if

I do not need the sum of the two Seasons, but a distinct count over the two seasons and with if

count (distinct {$<C_Stagione = {$(#sSaison1)}>} if (DT_Ordine >= if (isnull(dVon1) or dVon1 = '', DT_Ordine, dVon1) AND

                                                     DT_Ordine <= if (isnull(dBis1) or dBis1 = '', DT_Ordine, dBis1), C_Cliente, 0))

                                                      + count (distinct {$<C_Stagione = {$(#sSaison2)}>} if (DT_Ordine >= if (isnull(dVon2) or dVon2 = '', DT_Ordine, dVon2) AND

                                                     DT_Ordine <= if (isnull(dBis2) or dBis2 = '', DT_Ordine, dBis2), C_Cliente, 0))

If there would not be IF I would solve it like this

count (distinct {$<C_Stagione = {$(#sSaison3),$(#sSaison4)}>}  C_Cliente)

43 Replies
Not applicable
Author

After long checking I understand what the problem is

The result seems correct if

a) Current Selections = InputBox (ergo if sSaison1 + sSaison2 + sSaison3 + sSaison4 are a current selectios)

b) Further Selections are made

vishsaggi
Champion III
Champion III

I cant see any of your images you have uploaded? Did you solve your problem or are you asking to check for anything?

Not applicable
Author

Now solved

Not applicable
Author

=Count({

} distinct C_Cliente)