Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey there!
I am working on some project, and I want the expression to return '01:00:00' if "Hour beginning"<8 and "Hour end">8. Can't be done with an if condition because this expression will be part of a sum.
I have the following table, and my result is in the last column:
I have this expression:
aggr(sum({<[Hour A]={"<8"}, [Hour B]={">8"}>} '01:00:00'), [ID])
I don't understand why, but sometimes it randomly returns the wrong value... It was supposed to be '01:00:00' for all the table rows, but I randomly get other values.
Does anybody have a clue on what to do with this?
Thanks in advance!
Cheers,
Ines
You can use Avg() instead of Sum():
aggr(avg({<[Hour A]={"<8"}, [Hour B]={">8"}>} '01:00:00'), [ID])
Can you add another expression to you chart: Count(ID) to check if 20019528 is occurring twice in your data by chance.
Perhaps you have several records per ID value that meet those conditions. Try adding this expression to the chart to check: count({<[Hour A]={"<8"}, [Hour B]={">8"}>}[Hour A])
You can use Avg() instead of Sum():
aggr(avg({<[Hour A]={"<8"}, [Hour B]={">8"}>} '01:00:00'), [ID])
Yes, that's correct. That was my mistake. Thanks for your help
Thank you, it solved the problem!
Yes, I do. Actually I think I may have an error in my data, I have to check. Thanks