Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ch_riadh
Partner - Creator II
Partner - Creator II

Business day hours

Hello guys,

my business day is from 04am of today to 04am of tomorrow.

For Exemple transaction done at 2am of 05/09/2016 it should be stored on 04/09/2016.

So i want to create a fild 'BusinessDate'

like :

if(time(Createdate,'hh:mm')> '00:00' and time(Createddate,'hh:mm' )<'04:00'  , Transdate-1  , Transdate) as BusinessDate,

Createdate and Transdate exist in my Table.

Thanks

9 Replies
marcus_sommer

Maybe something like this:

date(floor(Createddate - 4/24)) as BusinessDate

- Marcus

saimahasan
Partner - Creator III
Partner - Creator III

So whats the issue you are facing???

Is it that the expression not working correct??

ch_riadh
Partner - Creator II
Partner - Creator II
Author

yes i want to create this BDATE
and this Businessday filed start from 04:00 to 04:00 of next day.

saimahasan
Partner - Creator III
Partner - Creator III

I tried the same expression and it worked well.

If i am not wrong, do you need the output something similar to this??

Untitled.png

jpenuliar
Partner - Specialist III
Partner - Specialist III

ch_riadh
Partner - Creator II
Partner - Creator II
Author

yes this is what i need.

But how you wrote it and where.

saimahasan
Partner - Creator III
Partner - Creator III

Hi

To whom are you asking??

ch_riadh
Partner - Creator II
Partner - Creator II
Author

‌to you

you wrot it in the editor right.

can you write it again for me please

or put a screenshot of the editor please

thanks

saimahasan
Partner - Creator III
Partner - Creator III

You can write this script:

This is the dummy data i have created.

A:

LOAD * INLINE [

    Time

    02:02

    01:04

    05:32

    10:30

    01:40

    03:59

    07:56

    21:54

    18:20

    16:30

    17:45

];

B:

LOAD Time,

  if(time(Time,'hh:mm')> '00:00' and time(Time,'hh:mm' )<'04:00'  , Date(Today()-1)  , Date(Today())) as Businessdate

Resident A;

DROP Table A;