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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources 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

Tab Row : Data contro data

Chart: Confronto valori progressivi ……

Expression: Nr. clienti YTD

Il giorno 02 mar 2017, alle ore 22:47, Vishwarath Nagaraju <qcwebmaster@qlikview.com<mailto:qcwebmaster@qlikview.com>> ha scritto:

Not applicable
Author

Not applicable
Author

vishsaggi
Champion III
Champion III

What is your expected value you have to see in that nr.ClientYTD field?

Not applicable
Author

32

only R14 would be 20 - only T25D would be 25 : therefore it shows 45 which is wrong because some are double

Not applicable
Author

Looking at this list you may understand what I need

THANK YOU

Not applicable
Author

IN "Nr. clienti PY" I solved it with

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

But i"nr.ClientYTD" has no conditions

Not applicable
Author

* but "Nr.Clienti YTD" HAS conditions dVonx and dBisx

vishsaggi
Champion III
Champion III

From which field you are getting this R14 and T25D ? I assume these values should be there in C_Stagione field? But i see only values with A and S numbers? Are these driven based on DT_Ordine?

Not applicable
Author

I have attached a new file (scrambled). Yes, they are C_Stagione. If you enter them in Input Box (see screenshot) the result is 45

P.S. As you see I am bit beginner

Il giorno 03 mar 2017, alle ore 15:45, Vishwarath Nagaraju <qcwebmaster@qlikview.com<mailto:qcwebmaster@qlikview.com>> ha scritto: