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 function with two conditions QlikSense

Hello,

I have a question about the set analysis below:

I have to calculate the number of Number field which met two conditions:

- Data avvio UAT pianificata must be between the Start and End of the Month and

- Data avvio UAT effettiva must be greater than Data Avvio UAT pianificata.

count({<[Data avvio UAT pianificata]= {'>=$(=AddMonths( MonthStart (Today()),-2))<=$(=AddMonths( MonthEnd (Today()),-2))'},

[Data avvio UAT effettiva]={'>$([Data avvio UAT pianificata])'}>}Number)

But it seems to count the number of Number field only taking into account the first condition.

Which is the error?

Thanks a lot for your help,

Ilaria

13 Replies
antoniotiman
Master III
Master III

Issue is Yor Dates are TimeStamp

and autoCalendar doesn't work properly.

I suggest You to create Date Like

Date(Floor([Data avvio UAT pianificata])) as [Data avvio UAT pianificata]/effettiva

Date of Enc...17620 is 30/06/2017 15:11:19 that is > 30/06/2017

antoniotiman
Master III
Master III

However try this

Count(If([Data avvio UAT pianificata] >= MonthStart(Today(),-2) and [Data avvio UAT pianificata] <= MonthEnd(Today(),-2) and 

(Floor([Data avvio UAT effettiva]) > Floor([Data avvio UAT pianificata])

or Len(Trim([Data avvio UAT effettiva]))=0), Number))

Not applicable
Author

IT IS WORKING NOW!!! I created the dates as you suggested with Floor in the script, than upload again the data and the same formula as before is now working!

Just a last thng :  what do LEN and TRIM in the following formula? Len(Trim([Data avvio UAT effettiva]))=0

Thanks a lot for your help and patience.

Have a nice weekend,

Ilaria

antoniotiman
Master III
Master III

This is a way to get Null Values (or Blank)

Regards,

Antonio