Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I need to set a condition in my expression to display the time only if it is >13:00:00 and <14:00:00
If(time(DATE_DEB)>'13:00:00', and time(DATE_DEB)>'13:00:00', '')
DATE_DEB has this format : 12/01/2016 12:32:55
any idea please
I would use hour/minute/second as fields within the datamodel. You could simply use:
hour(DATE_DEB) as Hour
or add a master timetable: The Master Time Table
and from this Hour your could create a flag-field, like:
if(hour(DATE_DEB) = 13, 1, 0) as HourFlag
or using Hour within a set analysis, like:
sum({< Hour = {13}>} value)
- Marcus
May be this:
If(Frac(TimeStamp#(DATE_DEB, 'DD/MM/YYYY')) > MakeTime(13) and Frac(TimeStamp#(DATE_DEB, 'DD/MM/YYYY'))< MakeTime(14), Time(TimeStamp#(DATE_DEB, 'DD/MM/YYYY')))
If(Frac(DATE_DEB)> (13/24) and Frac(DATE_DEB)<(14/24), Time(DATE_DEB))
nothing as a result
did as you said , if (HourFlag=1,Hour) but i get result like that :
The field Hour looked like a time and not a hour. How is Hour and HourFlag created?
- Marcus
Hi,
Can you please try below and let me know if it is fine.
if(replace(mid(a, Index(a,' ')+1),':','')>130000 and replace(mid(a, Index(a,' ')+1),':','')<140000,'',a)
Here, 'a' is the column
Thanks,
Sreeman
Hey there mate,
If you can make changes in the script you can make it something like this:
Table:
LOAD *,
Flag_Greater13 * Flag_Lesser14 as Flag
LOAD *,
if(hour(DATE_DEB) > 13, 1, 0) as Flag_Greater13,
if(hour(DATE_DEB) < 14, 1, 0) as Flag_Lesser14;
LOAD *
FROM [your connection to your database goes here];
Then use the Flag field in your set analysis like this:
=sum({$< Flag= {1}>} value)
This is by far the best option because you bring the complexity to the script which increases the rendering perfomance in your table if you have millions of rows and it's easy to understand
Best regards,
D.A. MB
i have to use time not hour