Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

antonybi
Contributor

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.

Tags (1)
1 Solution

Accepted Solutions
jyothish8807
Honored Contributor II

Re: need help

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
7 Replies
Partner
Partner

Re: need help

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

jyothish8807
Honored Contributor II

Re: need help

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
Contributor

Re: need help

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
Contributor

Re: need help

Hi Jyothish,

I tried the same but still no luck.

Capture4.PNG

jyothish8807
Honored Contributor II

Re: need help

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

Also can you share your script ?

Br,

KC

Best Regards,
KC
Highlighted
antonybi
Contributor

Re: need help

Hi Jyothish,

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

Thank u!

jyothish8807
Honored Contributor II

Re: need help

Cool

Best Regards,
KC