Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Daystart Function - time field

Hi.

Goal: Calculate all open tickets for a time intervall between 17:00 yesterday and 17:00 today;

(2) create this time intervall as one time field as "Today".

What i am assuming would be best is to use the daystart function. Here is the Pseudologic i am aiming to achieve.

open = date ticket was opened.

if  Date(Daystart(open > 17:00 (yesterday) & <17:00 (today)) = "Today".

is there anyone who has used this function for this purpose?

Best

Bradley

1 Solution

Accepted Solutions
Gysbert_Wassenaar

In your expression is missing the third parameter, making the fourth the third:

inDay(Reg_date, today(), 17/24) as NewDate,

Try inDay(Reg_date, today(), -1, 17/24) as NewDate,

See Sheet2 on the attached qvw for a some examples of counts using InDay


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

Look up the InDay function in the help file. I think that's the function you're looking for. You can specify when a day starts in that function.

Something like InDay( open, today(), -1 , 17/24)


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gsybert!

i have introduced the following code into the application (see below)

however it seems to make no difference to the count. I am wondering if the floor function cancels the timestamp on the date?

let

vToday = num (today(1));

LOAD
inDay( Register, today(), 17/24) as Register,
floor(Register) as old,
Case

your help is greatly appreciated in this matter.

Best,

Bradley

Gysbert_Wassenaar

Yes, using the floor function on a datetime (aka timestamp) will remove the time part. Can you post the document you're working on or an example with sample data?


talk is cheap, supply exceeds demand
Not applicable
Author

Hej Gysbert!

Thanks for your mail.

Here is the application I am working on as well as sample document;

Thanks again for your help, I appreciate it.

Best,

Brad

Gysbert_Wassenaar

In your expression is missing the third parameter, making the fourth the third:

inDay(Reg_date, today(), 17/24) as NewDate,

Try inDay(Reg_date, today(), -1, 17/24) as NewDate,

See Sheet2 on the attached qvw for a some examples of counts using InDay


talk is cheap, supply exceeds demand
Not applicable
Author

thanks a million!

Works great.

Best,

Brad