Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script where Today is between Start and End Date

Hi Guys

I need a script to return the only the record for:

where Today() is between Start Date Key and End Date Key

So the Table will be reduced based on one Coy No Record where Today(20170720) is between (Start Date Key and End Date Key)

Script dummy:

CompanyNumber:

LOAD [Coy No],

     [Start Date Key],

     [End Date Key]

FROM

Between.xls

(biff, embedded labels, table is Sheet1$);

   

Coy NoStart Date KeyEnd Date Key
1111112016080199991231

111111

2016070120160731
1111112016053020160630
1111112016051020160529
1111112016050120160509
1111112016040120160430
1111112016032020160331
1111112016030120160319
1111112016020120160229
1111112015121220160131
1111112015120420151211
1111112015112420151203
1111112015112320151123
1111112015111720151122
1111112015100920151116
1111112015090720151008
1111112015072520150906
1111112015062920150724
1111112015050720150628
1 Solution

Accepted Solutions
sunny_talwar

May be like this:

CompanyNumber:

LOAD [Coy No],

    [Start Date Key],

    [End Date Key]

FROM

Between.xls

(biff, embedded labels, table is Sheet1$)

Where [Start Date Key] <= Today() and [End Date Key] >= Today();

View solution in original post

8 Replies
sunny_talwar

May be like this:

CompanyNumber:

LOAD [Coy No],

    [Start Date Key],

    [End Date Key]

FROM

Between.xls

(biff, embedded labels, table is Sheet1$)

Where [Start Date Key] <= Today() and [End Date Key] >= Today();

Anonymous
Not applicable
Author

Thanks Sunny

Appreciate it

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use this:

LOAD [Coy No]

     ,date(date#([Start Date Key], 'YYYYMMDD'), 'YYYY-MM-DD') as [Start Date Key]

     ,date(date#([End Date Key], 'YYYYMMDD'), 'YYYY-MM-DD') as [End Date Key]

FROM

[https://community.qlik.com/thread/225815]

(html, codepage is 1257, embedded labels, table is @1)

where Today() >= date(date#([Start Date Key], 'YYYYMMDD'), 'YYYY-MM-DD') and Today() <= date(date#([End Date Key], 'YYYYMMDD'), 'YYYY-MM-DD')

;

Result:

Screenshot_3.jpg

See the attachment.

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!
Anonymous
Not applicable
Author

There is no button like that on my profile. Not sure if this is a glitch.

Can only reply or like and actions is 'none'

Anonymous
Not applicable
Author

Hi Chris,

In order to have the options to mark posts as Correct or Helpful, you will need to view the actual thread in the community. Those options are not available when replying by email or when viewing in your Inbox & Activity area of your profile.

Here's a link to the thread itself:Script where Today is between Start and End Date

Let me know if you're still having issues after trying this route.

Best regards,

Qlik Community Team

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

It's practically the same as marking the answer Helpful as you did for stalwar1 replay.

Anonymous
Not applicable
Author

Thanks, Correct button was missing on the Inbox link and could only mark as helpful/reply/like.

I did ask Qlik Qoncierge <qoncierge@qlik.com> to resolve and I now see the button again.

Thanks guys and Sunny for the Assistance