Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

abhaysingh
Contributor III

StartDate and EndDate Period Selection Qliksense

Hey Guys,

I have one Scenario in which User can able to select Start Date and EndDate and The data between that selected period should be displayed in Dashbords.

Please Advice..

Abhay

6 Replies
rsatish111
New Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Hi Abhay,

Define two variables , one for startdate and another for enddate as below :

Let vStartDate = Input('Enter Start Date (YYYY-MM-DD)' , 'Input required');

Let vEndDate = Input('Enter End Date (YYYY-MM-DD)' , 'Input required');

Once it's done you can use these variable in the where condition instead of date hard coding.

Use below syntax to use above variable :

Date column name used in your query >   '$(vStartDate)'

   AND

Date column name used in your query  <=   '$(vEndDate)'

This will work as a prompt to user to enter startdate and enddate while reloading data.

Thanks

Sattya

abhaysingh
Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Hi Satish,

Clarification Required..

Suppose I have a table structure like below...

Tab1:

Load Field1

          Field2,

          Date,

From Source...

Let vStartDate = Input('Date (YYYY-MM-DD)' , 'Input required');

Let vEndDate = Input('Date (YYYY-MM-DD)' , 'Input required');

Could You Please Help me here with script;

And how i can use these variable at front end.

or Can you provide sample please..

Thanks

Abhay

rsatish111
New Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Hi Abhay,

As per your query you need to add date prompt in where clause.

Let vStartDate = Input('Date (YYYY-MM-DD)' , 'Input required');

Let vEndDate = Input('Date (YYYY-MM-DD)' , 'Input required');

Tab1:

Load Field1

          Field2,

          Date,

From Source...

where Date  >    '$(vStartDate)'

and    Date <=   '$(vEndDate)'

Hope this will help you.

Thanks

Sattya

abhaysingh
Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Hi Sattya,

While reloading Application it is asking me Input Date??

and as i told you i need these start and end date at Front End as Selections.

Thanks

Abhay

rsatish111
New Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Hi Abhay,

Use list box with LED selection type so that user can select multiple dates as required. You can also use MonthName(Date) with LED option to select data of specific month( this will help when you have a long list of dates).

abhaysingh
Contributor III

Re: StartDate and EndDate Period Selection Qliksense

Can you pls provide me sample so i can have better clarity??

Thanks

Community Browser