Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in Expression !$@&^#

Hello again all,

I keep getting this while creating an expression!

count(Maintenance)



=count(if(StartDate <= CurrentDate) and (StartDate <= CurrentDate) and

(StartDate >= CurrentDate) and (StartDate >= CurrentDate));

What am I doing wrong!?!

Thanks in Advance!



1 Solution

Accepted Solutions
Not applicable
Author

Hi!

It looks like your expression is not completed. To make it easier I will break it down:

=count(

if(

StartDate <= CurrentDate and StartTime <= CurrentTime and EndDate >= CurrentDate and EndTime >= CurrentTime

,Maintenance

)

);

Remember the if statement works like:

if( criteria=met

,THEN

,ELSE)

BR

Jakob Berglund



View solution in original post

4 Replies
Not applicable
Author

What ??

Let me reduce your if condition to its effective part:

StartDate = CurrentDate

Please try to add some more details what you try to do.

Not applicable
Author

Hi,

You can write in this way

count(if(startDate<=CurrentDate and startDate>=CurrentDate ,Maintenance))

You have written "startDate<=CurrentDate " two times which i am not able to understand i think this should be one time only if condition is same and fields are same.

Regards,

Ravi

Not applicable
Author

MY BAD SORRY! IT SHOULD BE MORE LIKE THIS:

=count(if(StartDate <= CurrentDate) and (StartTime <= CurrentTime) and

(EndDate >= CurrentDate) and (EndTime >= CurrentTime));



Not applicable
Author

Hi!

It looks like your expression is not completed. To make it easier I will break it down:

=count(

if(

StartDate <= CurrentDate and StartTime <= CurrentTime and EndDate >= CurrentDate and EndTime >= CurrentTime

,Maintenance

)

);

Remember the if statement works like:

if( criteria=met

,THEN

,ELSE)

BR

Jakob Berglund