Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
antonybi
Creator
Creator

need help

Hi Folks,

I have two date columns with timestamp called closed date('DD-MM-YY hh:mm:ss tt') and deadline date('DD-MM-YY hh:mm:ss tt')


Now I have to create two flags
If ([closed date]<[deadline date],1,0) as flag1
If ([closed date]>[deadline date],1,0) as flag2

but not getting accurate results.

whats wrong with this.?

Pls help as so needful.

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Hi Antony,

Try like this:

If (timestamp(timestamp#([created date],'DD-MM-YY hh:mm:ss tt'))<timestamp(timestamp#([deadline date],'DD-MM-YY hh:mm:ss tt')),1,0) as flag1

If (timestamp(timestamp#([created date],'DD-MM-YY hh:mm:ss tt'))>timestamp(timestamp#([deadline date],'DD-MM-YY hh:mm:ss tt')),1,0) as flag2


Br,

KC

Best Regards,
KC

View solution in original post

7 Replies
vishalarote
Partner - Creator II
Partner - Creator II

can you please share your qvw file and data source file ?

jyothish8807
Master II
Master II

Hi Antony,

Try like this:

If (timestamp(timestamp#([created date],'DD-MM-YY hh:mm:ss tt'))<timestamp(timestamp#([deadline date],'DD-MM-YY hh:mm:ss tt')),1,0) as flag1

If (timestamp(timestamp#([created date],'DD-MM-YY hh:mm:ss tt'))>timestamp(timestamp#([deadline date],'DD-MM-YY hh:mm:ss tt')),1,0) as flag2


Br,

KC

Best Regards,
KC
antonybi
Creator
Creator
Author

actually am working on real data.

I have to create two flags based on these conditions.

Capture1.PNG

– if the ticket is closed (Closed Date) before the deadline date

– if the ticket is closed (Closed Date) after the deadline date


am not getting accurate results because of timestamp.


How to handle this??

antonybi
Creator
Creator
Author

Hi Jyothish,

I tried the same but still no luck.

Capture4.PNG

jyothish8807
Master II
Master II

CAn you share a sample format of the date fields you are loading ?

Also can you share your script ?

Br,

KC

Best Regards,
KC
antonybi
Creator
Creator
Author

Hi Jyothish,

I have removed timestamp# in your expression. Now it  is working perfectly.

Thank u!

jyothish8807
Master II
Master II

Cool

Best Regards,
KC