Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

wrong format

Hi all,

I am using below

Timestamp#(Date("RDate")&' '&Time#(Right("RTime",8),'hh:mm:ss'),'MM/DD/YYYY hh:mm:ss') as "R Date Timestamp"

am getting output as  10/09/2017 78865741     

but I need in   in 'MM/DD/YYYY hh:mm:Ss'   this format     it is giving  number I need hh:mm:ss

Rdate values:  10/09/2017

RTime values: 78865741       \

how to convert this?

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Sony,

your RTime field is being treated as a number of whole days - to convert to seconds you need to divide by 86400 (the number of seconds in a day)

For example:

Timestamp#(Date(RDate)&' '&Time(Right(RTime,8)/86400,'hh:mm:ss'),'MM/DD/YYYY hh:mm:ss') as [R Date Timestamp]

Marcus

View solution in original post

9 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Sony,

your RTime field is being treated as a number of whole days - to convert to seconds you need to divide by 86400 (the number of seconds in a day)

For example:

Timestamp#(Date(RDate)&' '&Time(Right(RTime,8)/86400,'hh:mm:ss'),'MM/DD/YYYY hh:mm:ss') as [R Date Timestamp]

Marcus

Peter_Cammaert
Partner - Champion III
Partner - Champion III

How about a simpler expression.

TimeStamp(Date#(RDate) + Time#(Right(RTime, 8), 'hh:mm:ss'), 'MM/DD/YYYY') AS [R Date Timestamp]

But we can only test this in a reliable way if we get some real data for RDate and RTime. Are they QlikViewq dual fields? Or just strings from an external source?

PrashantSangle

Try below

Date(RDate)&' '&Time(RTime)

what is converted valued of 78865741 in time?

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
soniasweety
Master
Master
Author

not working

soniasweety
Master
Master
Author

not working

PrashantSangle

can provide sample file.

What output you are getting after applying above expression?

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
mohammadkhatimi
Partner - Specialist
Partner - Specialist

can u provide sample data so that it is eay to resolve ur problem..

prieper
Master II
Master II

Please use

TIMESTAMP#(RDate, 'MM/DD/YYYY hh:mm:ss')

in order to transform the field containing the data.

Further you may convert this into a format, in which it should be shown:

TIMESTAMP(TIMESTAMP#(RDate, 'MM/DD/YYYY hh:mm:ss'), 'YYYYMMDD hh:mm')

Kushal_Chawda

RTime values are in minutes or seconds?