Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JishnuGS
Partner - Contributor III
Partner - Contributor III

How can i create Start Date and End Date from one Date field and show the data with in the range

Hi, 

I have a Date field and i want separate two filter as Start date and End Date and show the data in the chart according to the filter selection (range).

How can i achieve that ?

Could you please help me.

Thanks,
Jishnu 

1 Solution
3 Replies
OmarBenSalem

You can do as follow without changing ur script

let's assume this is your data : 

Load * Inline [

YourDateField, sales
01/01/2020 , 100
02/02/2020 , 300
03/02/2020 , 400
04/02/2020 , 300
05/02/2020 , 600
06/02/2020 , 200
07/02/2020 , 300
08/02/2020 , 500
09/02/2020 ,100
10/02/2020 , 1000

];

1) create 2 filters :

- Start Date as follow : YourDateField

- End Date as follow : =aggr(only({<YourDateField={">=$(=min(YourDateField))"}>}YourDateField),YourDateField)

=> that way, when you select a date in your Start Date filter, you'll only have dates >= your selected date in your End Date filter..

Now, in your measure, do as follow : 

Sum({<YourDateField={">=$(=min(YourDateField))<=$(=max(YourDateField))"}>}sales)

Result: 

No selection : 

Capture.PNG

 

2) I select 04/02/2020 in my Start Date , i'll only have dates >= my selection in the End Date filter :

Capture.PNG

 

I now select 08/02/2020 in my enddate, and i'll have the range between both dates:

Capture.PNG

 

Et voilà !

JishnuGS
Partner - Contributor III
Partner - Contributor III
Author

Thanks Kush it worked!!