| 3 data columns, one cell and IF statements? [message #1016787] |
Thu, 07 March 2013 11:57  |
Steve Brown Messages: 2 Registered: March 2013 |
Junior Member |
|
|
Hi, I'm new to this site, BIRT and Javascript so please be gentle with me! I apologise if this has already been covered but I as I'm new to this, I wasn't sure on the techical terms to search on.
I am converting a report into BIRT and have come across a field that in the old report seems to have an if statement to determine what data is displayed. The statement is saying:
If data in database column customerid does not equal '' (blank, not NULL) then display the data from column customerid...
If data in database column supplierid does not equal '' (blank, not NULL) then display the data from column supplierid...
If data in database column worksorderid does not equal '' (blank, not NULL) then display the data from column worksorderid...
Otherwise display nothing (would like BIRT to display "Not Applicable")
How do I go about writing an expression to do this? All the 3 columns referred to are in one Data Set in BIRT and all are in the same table in the SQL database. As I mentioned I'm a novoice so a step-by-step guide would be really helpful!
Thanks in advance!
Steve
|
|
|
| Re: 3 data columns, one cell and IF statements? [message #1016806 is a reply to message #1016787] |
Thu, 07 March 2013 13:05   |
|
You could either make a computed column for this, so you could just drag it from your dataSet, or you could put this in a dynamic text box or as a data element's expression, in your table.
if(row["customerid"] != "" && row["customerid"] != null){
row["customerid"];
}
else if(row["supplierid"] != "" && row["supplierid"] != null){
row["supplierid"];
}
else if(row["worksorderid"] != "" && row["worksorderid"] != null){
row["worksorderid"];
}
else{
"Not Applicable";
}
Hope this helps.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05825 seconds