Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Team,
I have two dates date1 and date2, I am finding difference between the two dates using interval function in an expression of straight table
Here I want the sum of whole expression.
my expression is
if(condition,interval(sum(date2-date1),'hh:mm','00:00')
which giving me difference in hours and minutes along with this I am able to find sum of the expression but in few cases where condition won't satisfy my expression will take '00:00' , in this cases the total sum of expression is not displaying.
Can someone suggest me the solution for this.
Thanks!!!
Thanks all for your support ,
It got resolved by changing "Expression Total' to "Sum Of Rows" option in expression tab of straight table.
Try 0 instead of a text value. Zero's can be summed and text values can't.
if(condition,interval(sum(date2-date1),'hh:mm'),0)
I tried with that, in this case the whole sum is showing as 0.
You are missing a bracket in your expression and you need to use 0 in the else condition as Gysbert says
if(condition,interval(sum(date2-date1),'hh:mm'),0)
HTH
Sasi
try
Interval(0,'hh:mm')
my expression in this thread was typo error, it is
if(condition,interval(sum(date2-date1),'hh:mm')) and I tried with both interval() and 0, still it is showing 0 or 00:00.
Thanks.
try
if(condition,sum(interval(date2-date1,'s')),0)
then you can divide the result by 60/60 to get the total hours
HTH
Sasi
Thanks Sasi,
I tried all these before, didn't work.
Any other solution to sum the numbers in string format.
Please share your app
Try this may be:
If(Condition, Interval(sum(date2-date1),'hh:mm'), Interval#('00:00', 'hh:mm'))