Skip to main content



      Home
Home » Archived » BIRT » Replacing one column with another column if null(How to replace column result if null with another column result)
Replacing one column with another column if null [message #1844602] Fri, 17 September 2021 07:11 Go to next message
Eclipse UserFriend
Hi,

I would really appreciate some advice with this

I have two columns which are giving results, one as email addresses and one as contact numbers = telephone, mobile, mobile2.

When the email result is null then the contact number contains a number.

These are separate communication methods from a table in sql.

What I would like to do is create a new computed column for both the email address and the telephone number, when emailaddress is null then replace with contactnumber = contact

I've looked at a few similar questions and found that entering the below script into the birt expression builder is accepted when you click validate, but it is not loading the report in the erp software I am using.

Is the expression itself correct?

if(row["destination"] == null){
row["contact"];
}
else if(row["contactnumber"] == null){
row["contact"];
}
else{
return true;
}


Kind regards,

Stuart
Re: Replacing one column with another column if null [message #1844612 is a reply to message #1844602] Fri, 17 September 2021 10:41 Go to previous messageGo to next message
Eclipse UserFriend
You might try something like this

if(row["emailaddress"] == null){
row["contactnumber"];
}
else {
row["emailaddress"];
}

What error are you getting from your erp?
Re: Replacing one column with another column if null [message #1844617 is a reply to message #1844612] Fri, 17 September 2021 12:30 Go to previous message
Eclipse UserFriend
Hi Jerry,

Your script worked, thank you very much, brilliant

The erp I'm using was previously giving me a page cannot be displayed message with my java expression..

Best wishes,

Stuart
Previous Topic:2 FIlters with OR not AND
Next Topic:BIRT with Latest Eclipse Verion
Goto Forum:
  


Current Time: Sun Mar 23 08:35:48 EDT 2025

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

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

Back to the top