Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi ,
i make a chart to calculate the percentage of how much the machine work in 24 h , but i want to make a condition if the day is saturday , i want just the percentage of 4 h not 24h .
thank you
I guess the easiest way I think is..
If you have a master calendar then you may also have a field Week Day in it.
If you don;t then create 1
MasterCalendar:
////Preceding load////
Load*,
if([Week Day]='Sat',1,0) as SatFlag;
////// Original Load//////
Load
weekDay(TempDate) as [Week Day]
...
...
From....
and in front end maybe use
Sum(amount)
/
(if([Week Day]='Sat',
sum({< SatFlag={1}, Hour= {4} >}Amout) ,
Sum(Amount)))
This may work if you have an Hour field where you can hard code 4
or Maybe an expert can help you on this...
Why not create the the column while loading in the script? i.e the column will contain either 24 or 4
if(weekday(your_datecolumn)='Sun' or weekday(your_datecolumn)='Sat' ,4,24) as Num_Hours_Counted_PerDay
A quick solution could be using an expression like this:
sum(Duration) / if(Weekday=6,4/24,1)
thanks guys ; im very grateful