Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a IF statement, which has an expression which sums and converts various time fields.
=num(if((Sum(Log_In_duration)/60)=0,' ' ( (SUM(Time)+SUM(Time2)+ ((sum(Time3)/3600)+sum(Time4)))/60)
/Sum([Log_In_duration]/60)), '##0 %')
In addition to the above formula which works as is, I need the formula to only return date specific data.
I have created a variable titled vcurrentweek from a field "DATE" and was looking to do a SET Analysis for current week and perform the above. However I am getting various errors and hoped someone could help.
Thanks
May be this?
=num(if((Sum(Log_In_duration)/60)=0,' ' ( (SUM({<DATE = {$(vcurrentweek)}>} Time)+SUM({<DATE = {$(vcurrentweek)}>} Time2)+ ((sum({<DATE = {$(vcurrentweek)}>} Time3)/3600)+sum({<DATE = {$(vcurrentweek)}>} Time4)))/60)
/Sum({<DATE = {$(vcurrentweek)}>} [Log_In_duration]/60)), '##0 %')
May be this?
=num(if((Sum(Log_In_duration)/60)=0,' ' ( (SUM({<DATE = {$(vcurrentweek)}>} Time)+SUM({<DATE = {$(vcurrentweek)}>} Time2)+ ((sum({<DATE = {$(vcurrentweek)}>} Time3)/3600)+sum({<DATE = {$(vcurrentweek)}>} Time4)))/60)
/Sum({<DATE = {$(vcurrentweek)}>} [Log_In_duration]/60)), '##0 %')
Hi,
Another simplified way u can try like below using set analysis
Num(sum( {$<Log_In_duration={"=Sum(Log_In_duration)/60)=0"},Year={"$(=Max(Year))"},Week={$(vcurrentweek)}>} (Time2+(Time3/3600)+(Time4/60))/ (Log_In_duration/60) ),'#,##0%')
Thanks Anil,
This works perfectly.
*Note:If anyone uses the code above in the future, there is a , missing before the false statement begins.
Thanks Devarasu
I am correcting myself
=num(if((Sum(Log_In_duration)/60)=0,' ', ( (SUM({<DATE = {$(vcurrentweek)}>} Time)+SUM({<DATE = {$(vcurrentweek)}>} Time2)+ ((sum({<DATE = {$(vcurrentweek)}>} Time3)/3600)+sum({<DATE = {$(vcurrentweek)}>} Time4)))/60)
/Sum({<DATE = {$(vcurrentweek)}>} [Log_In_duration]/60)), '##0 %')