Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Formatting dates in text boxes

Hi All,

I have a text box which displays the date from a listbox called 'Reporting_Date_Comp' when a date value is selected.

However, the values are not formatted.

For example, when I select '20130504' from the listbox, it will be displayed as 'Date: 20130504' in my text box.

Is there a way for me to format it such that it will be displayed as 'Date: 04/05/2013' instead?

Below is my working code in the text box:

='Date: ' & Reporting_Date_Comp

Tags (3)
1 Solution

Accepted Solutions

Re: Formatting dates in text boxes

='Date: ' & date(Reporting_Date_Comp,'DD/MM/YYYY')

It's possible that Reporting_Date_Comp is not yet a date, just a number. In that case you need:

='Date: ' & date(date#(Reporting_Date_Comp,'YYYYMMDD'),'DD/MM/YYYY')

Actually it would be better to do this conversion in the script.


talk is cheap, supply exceeds demand
4 Replies

Re: Formatting dates in text boxes

='Date: ' & date(Reporting_Date_Comp,'DD/MM/YYYY')

It's possible that Reporting_Date_Comp is not yet a date, just a number. In that case you need:

='Date: ' & date(date#(Reporting_Date_Comp,'YYYYMMDD'),'DD/MM/YYYY')

Actually it would be better to do this conversion in the script.


talk is cheap, supply exceeds demand
Not applicable

Re: Formatting dates in text boxes

Hi Gysbert,

I did the same formatting before, but it gave me this instead

Date: 22/06/57015

Is it because of its numerical representation?

er_mohit
Honored Contributor II

Re: Formatting dates in text boxes

try this

='Date: ' & date(date#('20130504','YYYYMMDD'),'DD/MM/YYYY')

Replace this with your datefield

Not applicable

Re: Formatting dates in text boxes

I rewrote the script and it works! Thank you

Community Browser