Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
trishita
Creator III
Creator III

How to show records for required date fields

How can I show only those Sounding_Start_Date in the chart  expressions which are after than the Survey date but within 7 days of the Survey Date..

Eg:

Its like I want to show the data for all those dates where Survey Date is 2018-04-03 and Sounding Start date is more than 2018-04-03 but within the range of 2018-04-10..I thought of using set analysis but i dont want to use count or sum on any specific quantity.I just want only those sounding start dates and respective fields are shown  which satisfies the given condition:

If([SOUNDING_START_DATE] >= [SURVEY_DATE] and [SOUNDING_START_DATE] < [SURVEY_DATE] + 7, 1, 0)

6 Replies
Anonymous
Not applicable

Hi

Why not create a flag in your script along the lines of if(match(interval([Sounding Start Date]+7-[Survey Date]),'0','1','2','3','4','5','6','7'),'Y','N')as Flag

Then you can use Flag=Y in your expression.

trishita
Creator III
Creator III
Author

Hi Brian,

I had used the following code :

Flag1:

If([SOUNDING_START_DATE] >= [SURVEY_DATE] and [SOUNDING_START_DATE] < [SURVEY_DATE] + 7, 1, 0)

and used it as a Flag

And in the column Sounding Date I had put the following code:

If(Flag1=1,Date(SOUNDING_START_DATE,'YYYY-MM-DD'), 'Not Corrected within 7 days')


Now How to exclude  the  Sounding Date='Not Corrected within 7 days'

Anonymous
Not applicable

Hi Trishita

OK unless I misunderstand then if your column Sounding Date either contains a date or 'Not corrected within 7 days' then couldn't you just use Sounding_start_date-={'Not Corrected within 7 days'} in your set analysis?

-= (with a minus sign before the equals sign) means does not equal in set analysis.

Kindest regards

B

trishita
Creator III
Creator III
Author

{$<Sounding Date-='Not Corrected within 7 days'>}

I am having syntax error: Garbage after expression Date

Anonymous
Not applicable

Apologies

try {$<Sounding Date-={'Not Corrected within 7 days'}>}

that should work.

trishita
Creator III
Creator III
Author

This is what I am having