Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Evaluate all datasets for nulls
stvns78
Hi, i am working on a custom report where the customer wants to replace all NULL with 'N/A'. I know how to accomplish this on a per field basis but that can be very tedious and time consuming. I have been looking through the script events when a report is run to determine what is the best place to add code to check for nulls in all datasets and replace them with 'N/A'. Should this be done beforeClose, afterClose, or during the presentation phase?
Any tips on Java code that would perform such action would also be helpful
Thanks
Mike
Find more posts tagged with
Comments
Jenkinsj5
You don't say what your data source is but if it is SQL data base (or simular) you can do something like this in your SQL query
ISNULL ( The_field, 'N/A' ) as 'The_improved_field'
stvns78
<blockquote class='ipsBlockquote' data-author="'Jenkinsj5'" data-cid="115004" data-time="1363109489" data-date="12 March 2013 - 10:31 AM"><p>
You don't say what your data source is but if it is SQL data base (or simular) you can do something like this in your SQL query<br />
<br />
ISNULL ( The_field, 'N/A' ) as 'The_improved_field'<br /></p></blockquote>
<br />
Im wanting to write JSP code in one of the events i.e. (onFetch) etc that will evaluate all fields in the returned dataset for nulls and replace it with 'N/A'. I do not want to add a NVL to every field in my query.<br />
<br />
Thanks
Jenkinsj5
<blockquote class='ipsBlockquote' data-author="'stvns78'" data-cid="115005" data-time="1363112704" data-date="12 March 2013 - 11:25 AM"><p>
Im wanting to write JSP code in one of the events i.e. (onFetch) etc that will evaluate all fields in the returned dataset for nulls and replace it with 'N/A'. I do not want to add a NVL to every field in my query.<br />
<br />
Thanks<br /></p></blockquote>
<br />
Ok, I don't speak Java, hopefully one of the others here can help you.
BArmstrong
Well, as for the java:
public String checkString(String str) {
if(str == null || str.isEmpty())
return "N/A";
return str;
}
Then call that function.