Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why are all dates selected by my date picker?

Hi,

I have constructed a date picker by having two calendar objects. The first sets vSearchDateStart and the other vSearchDateEnd. These two date pickers then do selections to the field Created1_TASK. This is done by triggers as such (showing triggers for the datepicker for vSearchDateEnd):

1. Set Variable vSearchDateStart: (this is a check to see that the end-date is not before the start-date)

=If(vSearchDateStart > vSearchDateEnd, vSearchDateEnd, vSearchDateStart)

2. Select in Field Created1_TASK:

='<=' & date(vSearchDateEnd) & '>=' & date(vSearchDateStart)

All works very well except when I select a date that is earlier than vSearchDateStart. If I do so then all dates in Created1_TASK are selected. This does not occur if I select the same value as in vSearchDateStart.

I guess there is something wrong with the logic in the Set variable but I can't figure out what.

Can anyone spot the problem?

1 Solution

Accepted Solutions
Not applicable
Author

I managed to fix this myself. The problem seems to be that even though the Set Variable-trigger is before the Select in Field-trigger, the Select in Field-trigger still uses the old variable value. I solved it by adding an IF-condition to the Select in Field-trigger, see below (note new variable names):

=if(vDateTaskCreatedStart > vDateTaskCreatedEnd, '>=' & date(vDateTaskCreatedEnd) &'<=' & date(vDateTaskCreatedEnd),'>=' & date(vDateTaskCreatedStart) &'<=' & date(vDateTaskCreatedEnd))

View solution in original post

1 Reply
Not applicable
Author

I managed to fix this myself. The problem seems to be that even though the Set Variable-trigger is before the Select in Field-trigger, the Select in Field-trigger still uses the old variable value. I solved it by adding an IF-condition to the Select in Field-trigger, see below (note new variable names):

=if(vDateTaskCreatedStart > vDateTaskCreatedEnd, '>=' & date(vDateTaskCreatedEnd) &'<=' & date(vDateTaskCreatedEnd),'>=' & date(vDateTaskCreatedStart) &'<=' & date(vDateTaskCreatedEnd))