Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
devaljain5
Contributor II
Contributor II

Select in field | to select date range and Null values

Hi All,

I have a requirement where if the user selects a Application Start and End Date, the straight table should display data within the Application start and end date range and also where application date is NULL. I am using the Select in Field Trigger but it's not working. Below is my expression:

='>='&Date(vStartDate,'MM/DD/YYYY') & '<='&Date(vEndDate,'MM/DD/YYYY') & '=' & ''

Please suggest

Labels (2)
1 Solution

Accepted Solutions
devaljain5
Contributor II
Contributor II
Author

Had to add below lines to the load script:

NullAsValue [Application Date];
Set NullValue = 'NULL';

AND the below expression in the trigger:

='(>=' & Date(vStartDate,'MM/DD/YYYY') & '<='&Date(vEndDate,'MM/DD/YYYY') & ' | NULL)'.

 

If someone has a solution without converting actual NULL value to 'NULL' value, please suggest.

View solution in original post

8 Replies
Anil_Babu_Samineni

Why Actions needed? I assume, Start Date and End Date is coming from one Field. If so, You can try below as dimension.

If(DateField>=Max(TOTAL [Start Date]) and DateField<=Max([End Date]), DateField)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devaljain5
Contributor II
Contributor II
Author

Hi Anil,

The selection is based on the filter (Calendar), hence based on the value user selects, the trigger should selection the dates within the date range and NULL values. Hence, using a trigger here.

Anil_Babu_Samineni

Why = and other symbols in the end? Can't you use simply as string and Field from Date?

='>='&Date(vStartDate,'MM/DD/YYYY') & '<='&Date(vEndDate,'MM/DD/YYYY')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devaljain5
Contributor II
Contributor II
Author

Because I need records where the [Date Field] is NULL as well

Anil_Babu_Samineni

Your syntax won't work. If you want null values try to enable the null values check box in the report?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devaljain5
Contributor II
Contributor II
Author

Had to add below lines to the load script:

NullAsValue [Application Date];
Set NullValue = 'NULL';

AND the below expression in the trigger:

='(>=' & Date(vStartDate,'MM/DD/YYYY') & '<='&Date(vEndDate,'MM/DD/YYYY') & ' | NULL)'.

 

If someone has a solution without converting actual NULL value to 'NULL' value, please suggest.

Anil_Babu_Samineni

Perhaps this? You can still use Error Handling and try below for string

=('>=' & Date(vStartDate,'MM/DD/YYYY') & '<='&Date(vEndDate,'MM/DD/YYYY') | 'NULL')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devaljain5
Contributor II
Contributor II
Author

Nayyy. Didn't work.

Gave syntax error and when adjusted to get rid of error, didn't pull the Null values.

 

Thanks for trying. _/\_