Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

adrianbuzer
Contributor II

Converting number to Text

Hi

I have a field called Time which is a numerical field.  If the time is 13:45:52 then the value will be 134552.  However, if the time is 00:03:24 then the value in the field is 324.  I would like it to show 000324 so that I can then use the maketime function to convert it back into a real time format.

So how can I convert the number 324 into text '000324' in the load script? Or is there another way to convert 324 into a time?

Thanks

A.

1 Solution

Accepted Solutions

Re: Converting number to Text

Can you try this:

Num(TimeFieldName, '000000') as TimeFieldName

Sample script:

Table:

LOAD Time(Time#(Num(TimeFieldName, '000000'), 'hhmmss')) as TimeFieldNew,

  TimeFieldName;

LOAD * Inline [

TimeFieldName

324

134552

];

Capture.PNG

2 Replies

Re: Converting number to Text

Can you try this:

Num(TimeFieldName, '000000') as TimeFieldName

Sample script:

Table:

LOAD Time(Time#(Num(TimeFieldName, '000000'), 'hhmmss')) as TimeFieldNew,

  TimeFieldName;

LOAD * Inline [

TimeFieldName

324

134552

];

Capture.PNG

Not applicable

Re: Converting number to Text

Hi Adrian,

Can you please try using the below script

load time,

     replace(time,':','') as one_way;

load * inline [

time

13:45:52

00:03:24

];

Thanks,

Sreeman

Community Browser