Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

hencovanee
Contributor II

Compare timestamps

Hi all,

I would like to create a report with all orders which are created after a specific date and time.

All orders have a created timestamp. I would like to see all orders which are created since 15:00 o'clock the day before today.

I tried different formats, but I can't get it done. Could someone please explain which format I need to use for the following fields to compare them?

  • Oracle database field: createdate
  • Variable in QlikView: date of today minus 1 (to show yesterday) + 15.00 o'clock

Many thanks!

Kind regards,

Henco

Tags (3)
5 Replies
simone_spanio
Valued Contributor

Re: Compare timestamps

Hi,

did you try to create in load script a field structured as YYYYMMDDHHMMSS? So it will be easy to comparate two integers...

S.

hencovanee
Contributor II

Re: Compare timestamps

Hi Simone,


Thanks for your reply.

I tried to load the createdate from the oracle database like this: to_char(aoadorder.createdate,'DD-MM-YYYY HH24:MI')

In QV I created a variable like this: timestamp#(today()&' 15:00')

But when I compare these two, it has no effect. So I assume I do something wrong with the formats.

Kind regards,

Henco

Not applicable

Re: Compare timestamps

Hi Henco,

I think you can use Timestamp#() function.After this it is just as simple as integer comparison.

Regards.

neetha_p
Honored Contributor

Re: Compare timestamps

Hi,

In script create variable:

Let vTime = Time(Frac(Today()-1),'03:00');

In UI:

=sum({$<Date={'>=$(=today()-1)'}, Time = {'>=$(=vTime)'}>} Amount)

Regards

Neetha

hencovanee
Contributor II

Re: Compare timestamps

Thanks, you pointed me in the right direction. Solved the problem by first checking the date and after that checking the time.

Regards,

Henco

Community Browser