Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Input box not updating field


Hi,

I created an input box with two variables: vStartDate and vEndDate. I checked the Custom constraint to force them to "MM/DD/YYYY"

format. I then went to variable triggers, and added "OnChange" for each the following string:

='>='&vStartDate&'<='&vEndDate for the field "LoginDate".

However, when I change the dates, the listbox for LoginDate does not change to reflect the new limits.

Is there something that needs to be checked/allowed at the document level for this to work?

Thanks,

Kevin

4 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

In order to troubleshoot the problem, create a text box and show the string that you are calculating in the Action:

='>='&vStartDate&'<='&vEndDate


Copy the same string and use it as a manual Search criteria on the LoginDate field.


Maybe you need to format the dates differently? For the Selection to work, the variable values need to be formatted exactly the same way as the LiginDate field is formatted - MM/DD/YYYY is not the same as M/D/YY for example...


cheers,


Oleg Troyansky

www.masterssummit.com


Not applicable
Author

Thanks, Oleg.. when I tried pasting the string into the Search area of the listbox, it said "no matches returned", when I could clearly see dates that fell between the two extremes.

So let me rephrase my question:

My field, LoginDate, is formatted "MM/DD/YYYY', as are the two variables vStartDate and vEndDate. Never mind the triggers for now.. can anyone tell me EXACTLY what syntax I need to enter into the Listbox to find the dates between these two extremes? I've noticed in the past that for anything involving a formula, I've had to use:(e.g)

=fieldname=FirstWorkDate(today(0)-1,1)

to select the previous working day. From other posts, it looked like I had to use a $ expansion (e.g. enter

='>='&$(vStartDate)&'<='&$(vEndDate)    which didn't work, then someone suggested:

='>='&$(=vStartDate)&'<='&$(=vEndDate) which didn't work either.

My heavens, this should be dirt simple! Do I need to enter the fieldname? Do I use $ expansion? It's a compound condition - shouldn't there be an "AND" somewhere?

Not applicable
Author

Well, I found out what the problem was, and it was as Oleg suggested - date formats. My db field was "dlogin", which was a complete timestamp (MM/DD/YYYY hh:mm:ss), so I put:

LOAD

     Floor(dlogin) as LoginDate,

     *;

into the script. However, this actually gave me MS date numbers (e.g. 41167), not date strings.

When I changed it to:

LOAD

     Date(Floor(dlogin),'MM/DD/YYYY'),

     *;

everything worked perfectly!

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Kevin,

I'm glad that you could resolve the problem, and that my explanation about formats was helpful.

I just wanted to make a semantic correction, to ensure that you and other readers have the correct understanding of the Date data type.

Dates are not strings, they are Dual values. A Dual value has both the numeric part (the MS date number in this case), and the textual part (the formatted date, determined by your settings). The dual nature of Date fields is very helpful for performing any Date arithmetic, sorting and comparing dates, while maintaining the ability to present the date as a formatted string on the UI.

Using Dates in Set Analysis is always tricky. We teach it in detail at the Masters Summit for QlikView.

cheers,

Oleg Troyansky

www.masterssummit.com