Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
harjotsingh16
Contributor II
Contributor II

Filter using between dates

Hello All,

 

I am new to Qliksense, I am trying to apply filter in date to get Text if the condition come between given two dates. I am getting error, can you please help me out?

 

Example: =IF((datetable>='1/1/2023'and datetable<='1/21/2023'),'P1',IF((datetable>='2/22/2023'and datetable<='3/30/2023'),'P2),Null())

Labels (3)
1 Solution

Accepted Solutions
therealdees
Creator III
Creator III

About the syntax, there's no need to close your If condition in parenthesis and if you're using nested IFs condition you must place them one inside another (in this case you placed the "else" Null() outside the first IFs conditions)

View solution in original post

4 Replies
therealdees
Creator III
Creator III

Hi!

 

The expression you provided had some syntax mistakes. Try this:

=IF(datetable >= '1/1/2023'and datetable <= '1/21/2023','P1', IF(datetable >= '2/22/2023'and datetable <= '3/30/2023','P2', Null()))

 

Also make sure to check if the dates in the expression matches the format for the actual field, otherwise it wouldnt work.

therealdees
Creator III
Creator III

About the syntax, there's no need to close your If condition in parenthesis and if you're using nested IFs condition you must place them one inside another (in this case you placed the "else" Null() outside the first IFs conditions)

harjotsingh16
Contributor II
Contributor II
Author

Got it 

 

Thanks!!

therealdees
Creator III
Creator III

Glad to help!

 

If you got the expected result, please mark the post as a solution so the topic can be closed and be available to help other people in the community.