Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
ankitbisht01
Creator
Creator

Date function is working fine on Text object but not at backend.

Hi all,

There is a small issue i am facing ,while Adding few hours to my "CREATEDDATETIME" field .

I need to make a new field which will have few hours added to old field  , for example i need to add 5:1/2 hours. 

When i add them in Text Object and select a date it shows desired result , but when i put the expression at back end script , i get blank field.

Format of my "CREATEDDATETIME" field : '3/31/2010 9:09:24 AM '

Function i am using on text object :  date(date(date#(CREATEDDATETIME,'MM/DD/YYYY hh:mm:ss tt'), 'MM/DD/YYYY hh:mm:ss tt')+ (330/24/60), 'MM/DD/YYYY hh:mm:ss tt').(this is working fine when i select any date from the filed shows me the right result regarding that date.)

Using same at Back end: date(date(date#(CREATEDDATETIME,'MM/DD/YYYY hh:mm:ss tt'), 'MM/DD/YYYY hh:mm:ss tt')+ (330/24/60), 'MM/DD/YYYY hh:mm:ss tt') as newdate

Best Regards

Ankit

1 Solution

Accepted Solutions
ankitbisht01
Creator
Creator

Thank you for your responses people, Anyhow got the solution from one of my friend. And it works like this with my script .

-- Timestamp(CREATEDDATETIME+Interval('5:30','mm:ss')) as NewDate

View solution in original post

7 Replies
nagarjuna_kotha
Partner
Partner

I have checked data in my app by using this code.

May be like this ?

Sample:

LOAD

date(date(date#(Date,'MM/DD/YYYY hh:mm:ss tt'), 'MM/DD/YYYY hh:mm:ss tt')+ (330/24/60), 'MM/DD/YYYY hh:mm:ss tt') as New

INLINE [

   Date

    3/31/2010 9:09:24 AM

];

I hope this may help

nagarjuna_kotha
Partner
Partner

Output  i m getting in the front end is :

03/31/2010  2:39:24 pm

Is this correct ?

-Nagarjun

CELAMBARASAN

Can you share some sample file, to figure out the issue.

Its working in my script, check the attachment.

manish_kumar
Partner
Partner

Hi Ankit

Please use this, it might help


Timestamp(CREATEDDATETIME+Interval('5:30','mm:ss')) as NewDate

ankitbisht01
Creator
Creator

Untitled.pngUntitled2.pngthis function is working with the inline table or sample table if i create any , but not with my field . sharing the screenshots of Scripting and front end results.

ankitbisht01
Creator
Creator

Yes and i am using the same script, as told before but not working on backend , however works find with text object

ankitbisht01
Creator
Creator

Thank you for your responses people, Anyhow got the solution from one of my friend. And it works like this with my script .

-- Timestamp(CREATEDDATETIME+Interval('5:30','mm:ss')) as NewDate

View solution in original post