
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want Day & Night Employee Shift time in QV
Hi,
I want Day flag & Night flag
My Day Shift Starts :
9.00 AM to 7.00 PM
My Night Shift Starts :
7.01 PM to 8.59 AM
Please send me script level code of this as soon as possible.
If i select Day : All records which lies in day shift is should come in DAY.
If i select Night : All records which lies in Night shift is should come in Night.
Regards
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or this:
If(Frac(FieldName) >= MakeTime(9) and Frac(FieldName) <= MakeTime(19), 'Day', 'Night') as Flag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share the sample data?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be create a flag in your fact table:
If(Hour(FieldName) >= MakeTime(9) and Hour(FieldName) <= MakeTime(19), 'Day', 'Night') as Flag
If(Hour(FieldName) >= MakeTime(9) and Hour(FieldName) < MakeTime(19), 'Day', 'Night') as Flag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or this:
If(Frac(FieldName) >= MakeTime(9) and Frac(FieldName) <= MakeTime(19), 'Day', 'Night') as Flag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you require QVDs used data or Report data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just need to understand how your data look like and on what field you want to do the calculation? You can show the screenshot of your sample QVD data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could I use this expression to create an Early, Late and Night Shift where the Early Shift runs from 08:00 to 13:59, Late runs from 14:00 to 19:59 and night runs from 20:00 to 07:59?
Many thanks,
Phil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be like this
If(Frac(FieldName) >= MakeTime(8) and Frac(FieldName) < MakeTime(14), 'Early',
If(Frac(FieldName) >= MakeTime(14) and Frac(FieldName) < MakeTime(20), 'Late', 'Night')) as Flag
