cancel
Showing results for 
Search instead for 
Did you mean: 

Right/Left functions not honouring data type on input

ThomasWilliams
Level 3
I'm not sure if anyone else has ever had issues with this but it seemed very strange and we can't reproduce the error either annoyingly. We have a data item that is input into a multi-calculation stage. The data item that is input is a collection but the column we are referring to within the calculation is 'text' type, NOT number (this is important). The data item input is a 13 digit number (we are storing this number as 'text' type in a data item intentionally). The multi-calculation stage takes the input, and performs separate calculations into 2 outputs Calculation 1: Left([Item Data.coll1], 2) - This is then output into another data item, also of type text Calculation 2: Right([Item Data.coll1], Len([Item Data.coll1])-2) - Again, this is also output into a data item that is of type text The idea of this calculation is to split the 13 digit input number into two sections. The first two numbers should go into the first data item output, and the remaining 11 into a second data item output. The first two numbers of the input data item were '18', the remaining section starts with a few zero's and then other numbers. E.G 1800012345655 However, here is then what was output into our two data items: Data item 1 - 18 (correct) Data item 2 - 12345655 (incorrect, leading zero's removed). I would expect the above behaviour if the input/outputs were of 'number' type but they are of type text so it looks like the right function didn't honour the data type for some strange reason? The logs from my process clearly show the collection column is of type text, and it only starts treating it like a number at this calculation stage. Again, just to be clear, the outputs are also of text type. Weirdly, I cannot reproduce this problem now with the same data, but I wondered if anyone had any similar experiences/suggestions?
1 REPLY 1

Denis__Dennehy
Level 15
Nope, I have never seen this before. It should be impossible because all the calculation stage is doing is exposing .NET functions - so what you are reporting is that .NET did not work correctly.