Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Diana_B
Contributor II
Contributor II

Wrong values after (left) join

Hi!

I am relatively new to QlikView and need your help with following problem:

When joining some fields from another table (see script below) I get wrong values in my pivot-table .

The dimension is [Patienten-ID] and expression in the table is just "sum(Therapieanzahl)" which should be 141 for one particular Patient-ID and after joining the value is 1128.

How can I solve this problem?

If you need further information please let me know.

Thx for your help!

Best regards,

Diana

Gesamtliste: 
LOAD [Patienten-ID], 
Therapiedauer_Buchstabencode, 
Div(Aufenthaltsdauer, 7) as [Aufenthaltsdauer in Wochen], 
Therapieanzahl, 
[KTL-Code], 
Therapieklasse, 
If(Aufenthaltsdauer>=7,'ja', 'nein') as [Aufenthalt_Berücksichtigung] Resident Gesamt_KTL ; 

Join LOAD [PatID] as [Patienten-ID], 
Patient, 
Fallnummer, 
Patklasse, 
Bereich, 
Bereich_lang 
Resident Abrechnungsbereich ; 

DROP Tables Gesamt_KTL, Abrechnungsbereich;

 

Labels (2)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

It's because the joining table doesn't have distinct values. 

From your code, if you check the table

Abrechnungsbereich

and you will find that it has duplicate values.

Try to remove the duplicate values to get the correct result.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

It's because the joining table doesn't have distinct values. 

From your code, if you check the table

Abrechnungsbereich

and you will find that it has duplicate values.

Try to remove the duplicate values to get the correct result.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Diana_B
Contributor II
Contributor II
Author

Thanks a lot! This works perfectly 🙂

Best regards,
Diana