Trouble with epoch time

Hi, I’d like to calculate the duration of streams. However, many streams are still on going, it’s 0 in the database. I converted it into GMT 7+ but it was 1970, therefore the duration was less much than 0. I tried using ifelse with this calculated field but i encountered an error. Thanks a lot !

dateDiff(min({live_ctime},[{feed_id}]),max({live_etime},[{feed_id}]),“SS”)/3600

image

if live_status = ‘1’ then max(live_etime,[feed_id]) wil be replaced by parameter $dateto (live_status = ‘1’ => The stream is ongoing)

Ah, I already figured it out. I just need to replace this with live_etime:
ifelse({live_status} = ‘1’, ${dateto}, {live_etime})