Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

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
Anonymous
Not applicable

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
Specialist II
Specialist II
Author

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

Anonymous
Not applicable

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
Specialist II
Specialist II
Author

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

Anonymous
Not applicable

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
Specialist II
Specialist II
Author

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

Thanks