Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Input Date for Further Usage in Variables QS

Hey guys,

I'm trying to manage with following:

I work in QS, I use an input box extension for user's input. I want customer could type in a date, which would be transferred to the next variable which is to transform it with my needs.

The pic can explain what I have now:

examp.png

If I leave only $(vGetDate) in the textbox, then it is 0.00074404761904762.

I don't understand how I can get the real date input.

Any help, please

Elena

3 Replies
Gysbert_Wassenaar

$(vGetDate) will 'evaluate' 3/2/2016. That means it treats the string 3/2/2016 as an expression. It will calculate 3 divided by 2 divided by 2016. That is about 0.0007. If represented as a date that value is the date with numeric value 0 (30/12/1899) + 0.0007... So some 10 minutes after midnight 31/12/1899.

What you need to do is create a date from it first: Date($(=num(Date#(vGetDate,'M/D/YYYY')))). Depending on where you use it just Date#(vGetDate,'M/D/YYYY') might work too.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I have tried your suggestion:

It still returns 31/12/1899.

I think that I should somehow put the apostrophes around $(vGetDate), but have no idea.

Anonymous
Not applicable
Author

To continue my reply attach the figure to show my thoughts:

examp.png