Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ValeriaBonini
Partner - Creator
Partner - Creator

week day

Hi, in my board I would like to show the day name extracted from today()
based on the name of the day, i would like to have different "work hours" to use for my calculations.

How can I do this?

EXAMPLE:

If the day is Monday, workHours= 22

Tuesday, workHours= 24

Wednesday, workHours= 24

Thursday,  workHours= 24

Friday,  workHours= 23

Saturday/sundays, workHours= 0

Labels (6)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi, function WeekDay() will provide you day of week

https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeF...

We can represent it with number (from 0 to 6) for easier understanding with num(WeekDay(today()))

So you can use simple if() to get your your worksHours:

if( num(WeekDay(today()))=0, 22,
if( num(WeekDay(today()))>0 and num(WeekDay(today()))<=3, 24,
if( num(WeekDay(today()))=4, 23, 0)))

View solution in original post

2 Replies
justISO
Specialist
Specialist

Hi, function WeekDay() will provide you day of week

https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeF...

We can represent it with number (from 0 to 6) for easier understanding with num(WeekDay(today()))

So you can use simple if() to get your your worksHours:

if( num(WeekDay(today()))=0, 22,
if( num(WeekDay(today()))>0 and num(WeekDay(today()))<=3, 24,
if( num(WeekDay(today()))=4, 23, 0)))

ValeriaBonini
Partner - Creator
Partner - Creator
Author

Thank you so much, it worked