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(expression) doesn't work

Hi,

I've got an expression :

=if(min({1} total <PAT_Ipp> MOD_Date_debut)>=date_nvx_pat,PAT_Ipp)

'PAT_ipp' is a field,'MOD_Date_debut' is a field, 'date_nvx_pat' is a variable ('date_nvx_pat'=min(total{$} calendrier_date))

This expression works fine, i manage to see the field 'PAT_Ipp'.

But when I want to count this field PAT_Ipp:

=count(distinct if(min({1} total <PAT_Ipp> MOD_Date_debut)>=date_nvx_pat,PAT_Ipp) )

It doesn't work and the expression editor tells me 'error in expression'. Can you tell me why ??? Because I have similar expressions (but with no variable) which works fine.

Thanks

4 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

i think that you need to expand your variable with the dollar sign:

=count(distinct if(min({1} total <PAT_Ipp> MOD_Date_debut)>=$(date_nvx_pat),PAT_Ipp) )

Regards

Not applicable
Author

Thanks for your help,

I tried this with no success. I tried without the variable ('calendrier_date' is a field) :

=if(min({1} total <PAT_Ipp> MOD_Date_debut)>=min(total{$} calendrier_date),PAT_Ipp) WORKS

=count(distinct if(min({1} total <PAT_Ipp> MOD_Date_debut)>=min(total{$} calendrier_date),PAT_Ipp) ) DOESN'T WORK (still same error message)

An idea ??

Not applicable
Author

I' also tried this with no success :

=count({$<Min({1} total <PAT_Ipp> MOD_Date_debut)>=min(total{$} calendrier_date)>} PAT_Ipp)

can someone help me plz ?? thanks

fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi, sorry I forgot to follow up this thread.

The possible problem with yout expression is that you are nesting a min() inside a count() . You cannot directly nest aggregation functions. You have to use the aggr function 'between' them. Something like Count(Aggr(Min(...)..)).

Hope this helps.

Regards,

Fernando