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

Start Date and End Date Filter data using the same field

I have an application I'm developing which looks like a straight table on the front end with several filters to the left of that table.

 

I'm using the vlib filter to select a single date which filters the associated table.

The problem I'm facing is our client requires that we have two date filters based on the same column. I need to figure out a way to create a vStartDate and vEndDate from a singular effective_date column. 

Labels (4)
1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In that case, I would have used Variable input object. Here are the steps that I have followed:

 

1. First I have a demo dataset:

 

2. Then I have created the following variables:

 

3. I have created 2 Variable input objects and a table with the data:

 

4. For the Variable input objects I have the following configuration:

a. Appearance > Variable > Name : vStart or vEnd (accordingly)

b. Appearance > Variable > Show as : Drop down (both)

c. Appearance > Values > Fixed or dynamic values : Dynamic (both)

d. Appearance > Values > Dynamic values: =Concat(Date, '|') (both)

 

5. For the table, I have removed the first Dimension "Date" and added the expression dimension "=If(Date>='$(vStart)' and Date<='$(vEnd)', Date)"

6. I have also un-checked the option "Include null values" for the dimensions and added the Label title "Date"

7. Now if I select dates from the Variable input object, I get:

 

As you can see, based on the dates range I select from the Variable input objects, I get my dates filtered on the table as well. 

 

NOTE: Please keep in mind, that your use case scenario might have other solutions as well, however this is the one that I would have gone for and you can get the idea behind to modify it based on your needs.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

2 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In that case, I would have used Variable input object. Here are the steps that I have followed:

 

1. First I have a demo dataset:

 

2. Then I have created the following variables:

 

3. I have created 2 Variable input objects and a table with the data:

 

4. For the Variable input objects I have the following configuration:

a. Appearance > Variable > Name : vStart or vEnd (accordingly)

b. Appearance > Variable > Show as : Drop down (both)

c. Appearance > Values > Fixed or dynamic values : Dynamic (both)

d. Appearance > Values > Dynamic values: =Concat(Date, '|') (both)

 

5. For the table, I have removed the first Dimension "Date" and added the expression dimension "=If(Date>='$(vStart)' and Date<='$(vEnd)', Date)"

6. I have also un-checked the option "Include null values" for the dimensions and added the Label title "Date"

7. Now if I select dates from the Variable input object, I get:

 

As you can see, based on the dates range I select from the Variable input objects, I get my dates filtered on the table as well. 

 

NOTE: Please keep in mind, that your use case scenario might have other solutions as well, however this is the one that I would have gone for and you can get the idea behind to modify it based on your needs.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
jean1
Contributor II
Contributor II

@Andrei_Cusnir why do you do this part?

 

d. Appearance > Values > Dynamic values: =Concat(Date, '|') (both)

 

Whenever I add this my chrome session crashes and says it's out of memory. If I leave the variables as 'input' and type dates without having them dynamically populate with the concat function this works. Thanks!