Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Or this:
If(Frac(FieldName) >= MakeTime(9) and Frac(FieldName) <= MakeTime(19), 'Day', 'Night') as Flag
Can you share the sample data?
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
Or this:
If(Frac(FieldName) >= MakeTime(9) and Frac(FieldName) <= MakeTime(19), 'Day', 'Night') as Flag
Do you require QVDs used data or Report data.
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
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
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