Discussion Board for collaboration on QlikView Scripting.
I try to join two tables, the main promble is duplicated data [Open Receivables]:
When I load data wihout join data looks correctly. I can't understand what the reason of issue
IF (IsNull(QUANTITY), 0, QUANTITY) As QUANTITY,
IF (IsNull(U_PRICE), 0, U_PRICE) As U_PRICE
SQL SELECT *
If(BILL > AMTPAID,
BILL - AMTPAID,0) as [Open Receivables]
Please align your example with the problem script - where your value INVOICE?
It looks like this value is not unique in txBilling, so you might need a group by in your SQL statement.
I've checked Treat and txBilling table. In txBilling table INVOICE values is not unique
can you post your data from Treat and txBilling without joining?
>>In txBilling table INVOICE values is not unique
Well there's your problem. Either sum the quantity and u_price values and group by the invoice #, or you will need to reconsider your model design.
if you join with you Treat table
you get this result
so, when your INVOICE doesn't unique in Treat it is not correct to join this table