Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date/Time format

Hi, I am trying to use a button to make my selection, I only want my button to return data for only the things that has happen today using this date format: 2012/02/29 10:06:00 AM,

this is the expresion I was trying to use but its not working

if(ReportType = 'Daily', Test_Date = Timestamp#(Today('2012/02/29 10:06:00 AM', 'YYYY/MM/DD hh:mm:ss'))

7 Replies
Miguel_Angel_Baeyens

Hi,

You need to add the AM/PM to the format:

if(ReportType = 'Daily', Test_Date = Date(Today(), 'YYYY/MM/DD hh:mm:ss TT'))

Hope that helps.

Miguel

Not applicable
Author

Hi Miguel

I used the same expresion as u suggested, but now it doesnt return the results according to the Daily filter I specified.

Regards

Edzi

Miguel_Angel_Baeyens

Hi Edzi,

Does the Date() function above return as you expected, and that the format is the same that the field Test_Date has? Apart from that, where are you using that expression? Is that an action? I should have asked before.

Hope that helps.

Miguel

Not applicable
Author

Hi Miguel

Yes the Date function retuns the corect values on theTest_Date field, but now the problem is that it doesnt return anything if I use the filter "Daily". and I am using the Exprestion on the expresion tab of the table chart that Im using to disply the results, I added the action "Set Variable" on the button that passes through the variable Report type to Table chart.

Kind regards

Edzi

Miguel_Angel_Baeyens

Hi Edzi,

I'm afraid I'm missing something. You original question was about a button to make a selection in a field. Did you try to create a button, and in its properties set a new Action, Selection, Select in Field, Test_Date and

=Date(Today(), 'YYYY/MM/DD hh:mm:ss TT')

as the Search String?

If this is not what you are after, would you mind to upload some dummy example so we can check further?

Hope that helps.

Miguel

Not applicable
Author

Hi Miguel

That’s exactly what I am trying to do, The problem only came up when changing the date formats, because when I am using the YYYY/MM/DD date format it doesn’t give me a problem. Please see the attached dummy model I am using!

Kind Regards

Edzisani Tshivhase

Systems Analyst | Software Developer

<http://www.fourier.co.za/>Fourier Approach (Pty) Ltd

Tel: +27 (0) 12 667 3232

Fax: +27 (0) 12 667 3244

Cell: +27 (0) 73 762 9982

Email: tshivhasee@fourier.co.za

Website: http://www.fourier.co.za<http://www.fourier.co.za/

Miguel_Angel_Baeyens

Hi Edzi,

Note that the function above returns a complete timestamp, and you may not have records with that timestamp. So I'd create a button with an action Select in Field Test_Date1, and the following as Search String:

=Date(Today(), 'YYYY/MM/DD') & '*'

Hope that helps.

Miguel