Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Neon Expression Builder - IF statement Syntax(how to format an if condition in BIRT chart expression builder)
Neon Expression Builder - IF statement Syntax [message #1840247] Fri, 09 April 2021 15:31 Go to next message
david moran is currently offline david moranFriend
Messages: 3
Registered: April 2020
Junior Member
Good morning,

in my source data i have several variables that are time duration values (in seconds). when combining these attributes in a BIRT bar chart,
using the expression builder, to get an average value from the raw 'seconds'
for example, i have this:

BirtMath.round(row["RPT1B2BTIME"]/(row["RPT1CONNCOUNT"]*60),1)

Yields an average value in minutes.
issue is if the "Rpt1ConnCount" is zero,
i have a divide by zero condition, which seriously messes up my graph.

i want to to set the condition something like this:

IF row["RPT1CONNCOUNT"] > 0
BirtMath.round(row["RPT1B2BTIME"]/(row["RPT1CONNCOUNT"]*60),1)

is it possible to do this in the expression builder?
if yes, do you have a syntax example i could follow?

Thanks,
David
Re: Neon Expression Builder - IF statement Syntax [message #1840254 is a reply to message #1840247] Sat, 10 April 2021 00:54 Go to previous message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
if(row["RPT1CONNCOUNT"] > 0)
{BirtMath.round(row["RPT1B2BTIME"]/(row["RPT1CONNCOUNT"]*60),1)}
else{null}
Previous Topic:Format Value in Chart Legend
Next Topic:Run-time parameter no longer defaults to "Null Value"
Goto Forum:
  


Current Time: Mon Sep 20 15:36:17 GMT 2021

Powered by FUDForum. Page generated in 0.01560 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top