Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all! thanks for taking time to read this newbie question! ![]()
I'm trying to do a select box like this
Morning
Evening
Night
Where:
Morning needs to be requestHOUR from 8:00 to 14:00
Evening needs to be requestHOUR from 14:00 to 18:00
Night needs to be requestHOUR from 18:00 to 00:00
This should select only those items between those hours.
Thanks all!!
Hi!
You can add this field in script:
load,
*,
If(requestHOUR>=8/24 and requestHOUR<14/24, 'Morning',
If(requestHOUR>=14/24 and requestHOUR<18/24, 'Evening',
If(requestHOUR>=18/24 , 'Night','N/A')
)
) as Shift
from ...
do you have a time field in your table if yes,
you can do it in two way.
1) load a inline mapping table with Time and DayNight column.
Time , Daynight
8:00,Morning
...
..
etc
and use applymap to add Daynight column in main table .
2)
you can use if condition
if (Time >=8 and Time <=14 , 'Morning') ....... etc as Daynight
both will solve your problem you may need to convert your hrs in num.
Thanks
BKC
try this,by using simple if statement..
if(requestHOUR>=8 and requestHOUR<=14,'Morning ',
if(requestHOUR>=14 and requestHOUR<=18,'Evening ',
if(requestHOUR>=18 and requestHOUR<8,'Night ',null())))
if u want use in load script just name as the above expression with alias name else u can use that script dirctly in ur expression wherever u want.
Sorry but still i dont get it
trying to do it but can't, do you have any complete example?
is't possible to share ur .qvw?
PFA
Huge thanks! i've just realized what i was doing wrong!