"java.lang.numberformatexception : for input string :"B50" - window

I am trying to open ADF configuration XML and the following error occurred while opening the diagram:
java.lang.numberformateexception :for input string:"B50"

It's a normal exception in Java when you will try to parse the number, but "this" number is not in reality. In your example, your data isn't a number - "or input string" - it is a string.
So, you have to use any methods for work with String

Related

My flow fails for no reason: Invalid Template Language? This is what I do

Team,
Occasionally my flow fails and its enough test it manually to running again. However, I want to avoid that this error ocurrs again to stay in calm.
The error that appears is this:
Unable to process template language expressions in action 'Periodo' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'.
And it appears in 2 of the 4 variables that I create:
Client and Periodo
The variable Clientlooks this:
The same scenario to "Periodo".
The variables are build in the same way:
His formula:
trim(first(split(first(skip(split(outputs('Compos'),'client = '),1)),'indicator')))
His formula:
trim(first(split(first(skip(split(outputs('Compos'),'period = '),1)),'DATA_REPORT_DELIVERY')))
The same scenario to the 4 variables. 4 of them strings (numbers).
Also I attached email example where I extract the info:
CO NIV ICE REFRESCOS DE SOYA has finished successfully.CO NIV ICE REFRESCOS DE SOYA
User
binary.struggle#mail.com
Parameters
output = 7
country = 170
period = 202204012
DATA_REPORT_DELIVERY = NO
read_persistance = YES
write_persistance = YES
client = 18277
indicator_group = SALES
Could you give some help? I reach some attepmpts succeded but it fails for no apparent reason:
Thank you.
I'm not sure if you're interested but I'd do it a slightly different way. It's a little more verbose but it will work and it makes your expressions a lot simpler.
I've just taken two of your desired outputs and provided a solution for those, one being client and the other being country. You can apply the other two as need be given it's the same pattern.
If I take client for example, this is the concept.
Initialize Data
This is your string that you provided in your question.
Initialize Split Lines
This will split up your string for each new line. The expression for this step is ...
split(variables('Data'), '\n')
However, you can't just enter that expression into the editor, you need to do it and then edit in in code view and change it from \\n to \n.
Filter For 'client'
This will filter the array created from the split line step and find the item that contains the word client.
`contains(item(), 'client')`
On the other parallel branches, you'd change out the word to whatever you're searching for, e.g. country.
This should give us a single item array with a string.
Initialize 'client'
Finally, we want to extract the value on the right hand side of the equals sign. The expression for this is ...
trim(split(body('Filter_For_''client''')[0], '=')[1])
Again, just change out the body name for the other action in each case.
I need to put body('Filter_For_''client''')[0] and specify the first item in an array because the filter step returns an array. We're going to assume the length is always 1.
Result
You can see from all of that, you have the value as need be. Like I said, it's a little more verbose but (I think) easier to follow and troubleshoot if something goes wrong.

Using field reference in UDP in IIB

I am setting reference to a field as a value to an UDP. see image. I wanted to reference the value at this path at runtime. Tried fetching the value using '{}' but seems like '{}' can't resolve path given in dots.
Second time tried fetching value using Eval function. Got stuck here too as Eval is throwing exception if my input has odd number of characters see error message
SET chrValue = EVAL(LocalTxnID);
Please resolve on how to read the input which is a reference in UDP at runtime. Why are the above methods not working
Looks as if these UDP values are for logging code. I see 'Global transaction id', 'Parent transaction id' and 'Local transaction id'. But IIB has built-in facilities for publishing messages with these fields (https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ac37860_.html). Is there a reason why you are not using those features?
Tried fetching the value using '{}' but seems like '{}' can't resolve path given in dots.
Correct. The {} syntax applies to a single NameExpression. You cannot use it to navigate multiple path segments.
Eval is throwing exception if my input has odd number of characters
The exception is reporting an invalid BLOB literal. That seems like a very strange error for an EVAL. Please check that you have quoted the correct error, and please also supply the exact string that EVAL received (if necessary take a user trace using mqsichangetrace, mqsireadlog, mqsiformatlog).

h2o Steam Prediction Servlet not accepting character values from python script

I am using Steam to attempt to build a prediction service using a python preprocessing script. When python passes the cleaned data to the prediction service in the
variable:value var2:value2 var3:value3
format (as seen in the Spam Detection Example) I get a
ERROR PredictPythonServlet - Failed to parse
error from the service. When I look at the PredictPythonServlet.java file it seems to only use the strMapToRowData function which assumes every value in the input string is a number:
for (String p : pairs) {
String[] a = p.split(":");
String term = a[0];
double value = Float.parseFloat(a[1]);
row.put(term, value);
}
Are character values not allowed to be sent in this format? If so is there a way to get the PredictPythonServlet file to use the csvToRowData function that is defined but never used? I'd like to not have to use One-Hot encoding for my models so being able to pass the actual character string representation would be ideal.
Additionally, I passed the numeric representation found in the model pojo file for the categorical variables and received the error:
hex.genmodel.easy.exception.PredictUnknownTypeException: Unexpected object type java.lang.Double for categorical column home_team
So it looks like the service expects a character string but I can't figure out how to pass it along to the actual model. Any help would be greatly appreciated!
The prediction service is using EasyPredictModelWrapper and it can only use what the underlying model uses. Here it's not clear what model you use, but most use numerical float values. In the for loop code snippet you can see that the number has to be float.

Conditional formatting with repository variable

I am trying to conditionally format a graph with a repository variable. My goal is to end with a number between 1-12 which corresponds to the current month.
When I try,
biServer.variables['CURRENT_MONTH']
I get the following error:
Graphing engine is not responding.
"A fatal error occurred while processing the request. The server responded with: oracle.bi.nanserver.fwk.exception.BISvsException: java.lang.NumberFormatException: For input string: "2014 / 07"."
Trying the following,
RIGHT(biSerber.variables['CURRENT_MONTH'],2)
I get an error:
"A type mismatch occurred while evaluating an expression."
Finally, the follow also errors.
RIGHT('biServer.variables['CURRENT_MONTH']',2)
"The syntax of the expression to be evaluated is invalid."
Anyone have ideas? Thanks.
I ended up with a workaround that is serviceable but not ideal.
I added a new column and created a custom formula where the month number, in this case "7", is compared to the repository value CURRENT_MONTH. If CURRENT_MONTH is greater than 7, then return ".", else return "null". (The period being the least noticeable character I could think of)
From here I added the new column to the graph and set a conditional format on that column where if the value is equal to not null (a period in this instance), apply the desired conditional format.
The following link was most helpful for me.
http://bidirect.blogspot.com/2013/10/conditional-formatting-is-it-possible.html

SQL Server Reporting Studio (SSRS) sorting error

I am attempting to allow a dynamic sort on a text box on an SSRS report. The field upon which I am trying to sort will either have an "A" or a decimal number. I am wanting to sort the decimal numbers in descending order. The expression I am using is:
=iif(isnumeric(Fields!CommScore.Value), (cdbl(Fields!CommScore.Value)*-1),6)
For the decimal number will never be larger than 5. The error I get is:
The sortexpression for the text box 'textbox74' contains an error. Input string was not in a correct format. (rsRuntimeErrorInExpression)
I imagine this is something simple. What am I doing wrong?
The error relates to the CDbl function throwing an exception when trying to convert A to a number. Yes, I know you're checking if it is numeric first but IIF is not a language construct, it is a function and as a function it evaluates all its parameters before passing them to the function. This means that both the true and false parameters get calculated even though one will be discarded.
Try the Val function. It has the benefit of not erroring when it gets passed non-numeric data - it just does the best it can to convert it.
=IIF(IsNumeric(Fields!CommScore.Value), (Val(Fields!CommScore.Value)*-1), 6)

Resources