New topic Closed topic
avatar image
1
Good way of capturing value Number expression?
By Created , last editted

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)

Answers
Sort by:

This topic is closed.