Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TJoin and TMap and BigDecimal with a precision specified

Dear Forum and Talend,
I was wondering if anyone had ever come across a problem with using TJoin or TMap to join result sets where one of the join columns is a BigDecimal with a precision specified (e.g. in Oracle tha columns is defined as number(14,4) )
Both TJoin and TMap seem to not match on this type of column .. i.e. some of the rows which do actually match come through the non matching result set ...
???
Has anyone else seen this or encountered this? or have a solution to this?
thanks, Allan.
Labels (2)
27 Replies
jkrfs
Creator
Creator

I switched it back to FLOAT and it works fine, but I am curious if this is a bug? Why can I not compare two BigDecimals in a tMap?
alevy
Specialist
Specialist

Using BigDecimals for the lookup key works fine for me in v4.1.3 even if the two columns have different length and precision...
jkrfs
Creator
Creator

Weird, I am using 4.2M4.
alevy
Specialist
Specialist

You should never use Milestone releases other than for beta-testing given the potential for outstanding bugs. I strongly suggest you urgently upgrade to v4.2.2 and try again.
jkrfs
Creator
Creator

I got this before 4.2.2 was released, I'll upgrade now.
alevy
Specialist
Specialist

I just encountered this problem using v4.1.3. It's caused by the scale (i.e. precision i.e. decimal places) of the BigDecimal amounts. If I force the two amounts to have the same scale, even if no rounding is required, then the lookup works. I no longer have the test I used for my post on 29 June but I doubt I had main and lookup with different scale. I've submitted a bug.
jkrfs
Creator
Creator

I forced both of them to have the same scale, but of course this is to the 8th place (which is what we use in our DB), perhaps I need to cut it down to 3 places to enforce the matches. Another weird thing is that both amounts when I was testing this was .0 all the way, maybe I'm wrong.
alevy
Specialist
Specialist

BigDecimals don't lose accuracy like floating-point variables do so they should match correctly if each side has the same number of places. Remember that the actual scale of the Java variable is not necessarily (even unlikely to be) the same as the schema precision. Did you use .setScale to force the scale? You can see the exact scale by printing it (System.out.print) or use .scale() to get the number.