
Good way of capturing value Number expression?
I got a number expression in which I save a counter of upvotes. If no votes are found i want the value to be 0 instead of nil. Is this the best solution?:
sum(var:record.votes.upvote_counter) + 0
Or should it be more like this?:
nil?(sum(var:record.votes.upvote_counter)) ? 0 : sum(var:record.votes.upvote_counter)
I got a number expression in which I save a counter of upvotes. If no votes are found i want the value to be 0 instead of nil. Is this the best solution?:
sum(var:record.votes.upvote_counter) + 0
Or should it be more like this?:
nil?(sum(var:record.votes.upvote_counter)) ? 0 : sum(var:record.votes.upvote_counter)
Login to reply