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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to sum from two tables

Hi All,

Please i have a question

i have a field called ABC in table called table1

and field called XYZ in table called table2

i have for each item in this 2 tables to sum the sales

some items are the same in the 2 sheets

and i want a table which sum the sales for similar items

i.e

i have

ABCSales
Raw Material200
Medicine300
Wages150
Others400
Depreciation50

and i have

XYZSales
Raw Material300
Wages200
Depreciation400

what i want is to make chart straight table for example

and to have the items in table1 and table2 are summed

the final table i want should be

anythingSales
Raw Material500
Medicine300
Wages350
Others400
Depreciation450

How can i do that??

Thanks in Advance

Best Regards,

Mona

17 Replies
Not applicable
Author

i have in the script table called

table1_1:

load COM

ABC;

table1_2:

load COM

ABC;

table1_3:

load COM

ABC;

table2:

load COM,

XYZ;

all this tables are matched to another table called Balance

it has this fields COM,

Net Balance

i want to have 3 charts in the front end

the first one it's dimension is ABC

and the expression is sum(Net Balance)

the second one it's dimension is XYZ

and the expression is sum(Net Balance)

the third one it's dimension is (this is my question)

and the expression is sum(Net Balance)

i want the third one to sum the net balance of chart1 and chart2 for similar items in the two fields XYZ and ABC

Hope the problem is clear now

Thanks.

Not applicable
Author

any Ideas??

Anonymous
Not applicable
Author

don't you have synthetic keys?? COM,ABC is in 3 tables?

doesn't seem logical to mee ... maybe it is better to combine some stuff at loading

Not applicable
Author

no,

there's resident in each table

AnyWay,suppose they are one table

Anonymous
Not applicable
Author

It sounds confusing to me ... but try something with an if-construction in the expression ... and combine the 2 dimensions at loading time in a table ...

martinpohl
Partner - Master
Partner - Master

qlikview cognize that the tables 1_2, 1_2 and 1_3 have the some fields.

So, if you don't forbid with noconcatenate you will onl yhabe one table for the first 3 databases.

The other problem is not clear.

Make an example in Excel.

llauses243
Creator III
Creator III

Hi,

This is my offer, pls to see image attached

Good luck, Luis

Anonymous
Not applicable
Author

I think the solution of Luis Laura is a good proposal!