Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
trishita
Contributor 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
briancopple
Contributor II

Re: How to show records for required date fields

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
Contributor III

Re: How to show records for required date fields

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'

briancopple
Contributor II

Re: How to show records for  required date fields

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
Contributor III

Re: How to show records for  required date fields

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

I am having syntax error: Garbage after expression Date

briancopple
Contributor II

Re: How to show records for  required date fields

Apologies

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

that should work.

trishita
Contributor III

Re: How to show records for  required date fields

This is what I am having