Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Error Creating Computed Columns
rtruban
Hello,<br />
<br />
I am trying to use a tip posted by Virgil Dodson for converting dates. <br />
<br />
I create a Computed Column using this in the expression and it works fine:<br />
<br />
<span style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif'><span style='font-size: px;'>df = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd");<br />
myDate = df.parse(row["my_date_field1"]);<br />
myDate;<br />
<br />
But when I attempt to make the second computed column in the same data set using the same script:<br />
<br />
</span></span><span style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif'><span style='font-size: px;'>df = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd");<br />
myDate = df.parse(row["my_date_field2"]);<br />
myDate;<br />
<br />
I get this error:<br />
<br />
'Wrapped java.lang.NullPointerException (unamed script#1)<br />
<br />
Reason:<br />
An unexpected internal exception occurred. Please see log for detail."<br />
<br />
<br />
Can't find a log file but the "Details" are:<br />
<br />
Plug-in Provided:Eclipse.org<br />
Plug-in Name:BIRT Designer UI<br />
Plug-in ID:org.eclipse.birt.report.design.ui<br />
Version:2.5.1.v20090903<br />
Error Code:Error.GUIException.invokedByUnexpectedException<br />
Error Message:</span></span><span style='font-family: Verdana, Geneva, Arial, Helvetica, sans-serif'><span style='font-size: px;'>Wrapped java.lang.NullPointerException (unamed script#1)<br />
<br />
Sorry I can't include the actual report file, my customer doesn't allow internet connectivity from our production network. <br />
<br />
Has anyone had a problem with multiple computed columns in one dataset before?<br />
<br />
Any insight would be greatly appreciated!<br />
<br />
Thanks,<br />
<br />
Rob<br />
</span></span>
Find more posts tagged with
Comments
mwilliams
Hi Rob,
I just tried the same with a flat file with two fields of date strings and two computed columns converting them to dates with this same code and received no error in 2.5.1. Is your customer's data coming from a flat file as well?
CBR
I guess the problem is in the java method parse of the SimpleDateFormat object.
Per definition this method throws a NullPointerException (the error you re seeing) if the parameter is null.
I think the problem with myDate = df.parse(row["my_date_field2"]); is that row["my_date_field2"] doesn't exist.