Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expressionless Expressions

I am trying to extract data from a table and count the result.  I am using a Chart/Pivot Table to do this.  The expression runs:

 

This is giving me a blank table when I am expecting results (I am querying the data using another method so that I can check whether the result is what I expect).

If I just put in the expression for the start date I get a result but not the end date.  What have I missed? There are dates in the table that meet these criteria

= sum(if(Field1 < 4 and date(start,'yyyy-MM-dd') <= today() and date(end,'yyyy-MM-dd') > today() ,1,0))

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Make sure the values in the fields start and end are real dates and not string values. Or try using the date# function instead of date:

=sum(if(Field1 < 4 and date#(start,'yyyy-MM-dd') <= today() and date#(end,'yyyy-MM-dd') > today() ,1,0))

Perhaps you need to format today() too: date(today(),'YYYY-MM-DD')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Make sure the values in the fields start and end are real dates and not string values. Or try using the date# function instead of date:

=sum(if(Field1 < 4 and date#(start,'yyyy-MM-dd') <= today() and date#(end,'yyyy-MM-dd') > today() ,1,0))

Perhaps you need to format today() too: date(today(),'YYYY-MM-DD')


talk is cheap, supply exceeds demand
Not applicable
Author

I am now getting results - thank you.  My only problem now is with the data being recovered, but that is my problem!

Thanks again