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

date to date filter problem

Hello,

I have a problem with the date's format and my filter date to date.

My date format is : DD/MM/YYY hh:mm:ss and I can't change it in the load script. But with the calendar tool of Qlikview, when I select a date and put it in a variable I have the format DD/MM/YYY.

Capturedatedate.PNG

And then when I have my start date and my end date I use :

='>=$(=date($(vStartDated2))) <=$(=date($(vEndDated2)))'

To select all the date between start and end.

How can I change the format of a variable, or add the hh:mm:ss to my 2 variables ?

If someone have an idea !

Thank you in advance.

3 Replies
marcus_sommer

If you really need these timestamp then keep them but to use dates you will need dates and not a timestamp. Therefore I suggest to create two further fields with:

date(floor(YourTimestampField)) as Date,

time(frac(YourTimestampField)) as Time

- Marcus

Not applicable
Author

No I don't need it, sorry i didn't mention it, but the hh:mm:ss is not used at all.

So you suggest to create a new filed in the load script with :

date(floor(YourTimestampField)) as Date,

The thing when I try to change the format in the load script with Date(date_saisie) as date_saisie it doesn't work, I have a error during the load.

marcus_sommer

You are missing the floor-function which will cut the time-part from the value then date is only a formatting-function for dates and couldn't handle the timestamp. Therefore try this:

Date(floor(date_saisie))

- Marcus