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

Get two specific values from different tables

Hey!

I'm trying to develop a chart for a dashboard. I have two different tables with the same common key (but that key has different names in the different tables (wallet & bonus_receiver)).

Basically in one table, the PK is "wallet" and in the second one, it is "bonus_receiver" (also a wallet id). In both tables, there are multiple lines with transactions for those wallets with the amounts. I can sum the amount of all transactions and aggregate it per wallet and per bonus_receiver.

I want to do this subtraction: sum(amount per wallet) - sum(amount per bonusi_receiver). All this per specific wallet in order to have the difference between both tables per wallet. As I'm trying to do this in a chart, I want the x axis (dimension) to be the wallet id (that can be the wallet field as well as the bonusi_receiver once they have the same values) and the measure I want that to be the substraction.

How can I do it? I believe I need to pick the wallet field in the first table and search that value in the second table but when I try it runs out of time.

I'm attaching a print of the two different tables and the 4 fields I'm talking about so you can understand. Thanks!

2 Replies
meghana2006
Contributor
Contributor

Hi,

I think doing join between the two tables using wallet and bonus receiver will resolve the issue.

With that the new table will have wallet, sum(amount per wallet), sum(amount per bonus receiver) which makes the subtraction easy.

Hope this will help. Thanks!

tomasfsa
Contributor
Contributor
Author

But I was trying to solve this without changing anything from the backend script. Only from an expression in the chart functionalities. Any idea?

Thanks in advance