Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
VL126
Contributor
Contributor

Summing data from 2 or more tables in a pivot table

Hi,

I have 2 tables that are in diff shapes (diff number of columns) but they do have common fields like below :

Table 1Field AField BField CField DField EField FField G 10 other columns 
          
Table 2Field AField BField CField DField EField FField G5 other columns 

 

What i want to do is to create a pivot table which add up the value field (say field G) from the 2 tables. My pivot table would be something like this :

2 Row Dimensions : Field A and Field B

3 Column Dimensions : Field C/D/E

Value : sum of Field G from 2 tables

Pivot Table Column  
   Field C  
   Field D  
   Field E  
RowRow    
Field AField B Sum of Field G from 2 tables

 

I tried having associate say using Field A of the 2 tables to build the pivot and in the measure expression I used Sum (field G) Table 1 + Sum of field G Table2. What I notice is, say if Field A could have 3 diff values, the for value 1 of Field A, the Field G presented with some numbers. When scroll down further, value 2 of Field A got exactly  the same numbers in the pivot as per value 1 above. Same happen for value 3 under field A. 

Could anyone advise me what went wrong? 

 

 

0 Replies