Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate Sums from unlinked keys

Hello !!

my actual Problem is, that have the following 2 tables with product turnover data and product stock data. I know, that the productnumber is equal in both tables but I do not want QlikView script to join both fields, as my Intention is to get the sum of the turnover and additional stock data without influencing one selection with the other. I hope my example witll help to get answers from you all.

Table1:

ProductId1Turnover
Prod1100
Prod2120
Prod380
Prod490

Table2:

ProductId2StockOnStock
Prod1AT5
Prod1DE1
Prod2AT3
Prod3AT10
Prod3DE1
Prod4DE6

Now I want to have a diagram Chart with the following totals:

When I do not select a Stock, I want to see:

ProductId1TurnoverOnStock
Prod11006
Prod21203
Prod38011
Prod4906

When I select "AT", I want to see:

ProductId1TurnoverOnStock
Prod11005
Prod21203
Prod38010
Prod4900

Any idea, how I can achieve this ?

Best regards, Sascha

6 Replies
simenkg
Specialist
Specialist

You can join the tables or keep them separate but as long as the Field name is identical in them both they will be linked. But this is what you want.

When they are linked your expressions become:

Turnover:
Sum({<Stock=>} Turnover)

OnStock:
Sum(OnStock)

sunny_talwar

PFA

Best,

S

Anonymous
Not applicable
Author

Hi, your example is great, but des this mean, I have to add the {<Stock=>} restriction to all my summaries in my existing QlikView App (because my example has been only a part of the whole) ? I hoped, I could have a solution I only have to add to the sum of teh OnStock value without the Need to Change all the other formulas.

sunny_talwar

If you don't want a particular expression not to change on a selection for a particular field name, you have to specify that within your expression. Else the expression won't know when to change and when not to change.

HTH

Best,

S

Anonymous
Not applicable
Author

OK, I will have to take that into account. I hoped there is an expression like "sum(<{ProductId2 = ProductId1}>OnStock)" or something similar to get it done this way.

Anyway, thanks for your quick Feedback.

sunny_talwar

Not a problem. Have a good day.

Best,

S