Hi,
Im am trying to filter on my column "Account_number" which is type float(10,2).
I then in the tfilter add "Account_number" as inputColumn, function is empty, operator is "Equals" and value 30000 as that is the number I would like to filter upon.
I then get the error "The method compareTo(Float) in the type Float is not applicable for the arguments (int).
What am I doing wrong?
Hi,
Could you please elaborate your case with an example with input and expected output values? As we known that you cannot compare two different data type. The expression should be: compareTo(String anotherString)
Hi,
What I would like to do is that I would like an interval of accounts between 30000 and 30900 to be mapped as "Revenue" and all other accounts to be mapped as "Costs".
Meaning I have a charts of accounts table where the accounts go from 30000 to 79000, I would then like to split them into two - a revenue part (30000 to 30900) and Costs (the rest of the accounts).
My idea was to either use the tfilter to split accounts into two - or use the tmap and to the same while adding a new column on the two outputs stating either "Revenue" or "Costs". But then I get the problem that I have the accounts in the format float, but it seems like the tfilter would like them to be integer.
Can I get around that somehow?
Best regards
Morten
You need to ensure that the fixed value you're comparing to is the same type as your column. 30000 is treated by Java as an int but your column is a float, so instead you should use the fixed float value 30000f.
If you use the advanced mode of tFilterRow, your filter expression is used in the code exactly as written. There is then no difference to the filtering that tMap would do, which also uses the filter expression exactly as written. However, tMap has a lot more overhead as it can do so much more than just filter rows.
If you use the normal mode in tFilterRow, the settings you choose are translated into a Java expression in the code that might not be the same as if you had written it yourself. The difference in that case will depend on which expression is more efficient and appropriate to your purpose.