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

Two fields in one table relate to another table

I have one table with two fields relating to the same table.

First table is called Invoice with the following colums:

  • InvoiceID
  • From_customer
  • To_Customer
  • Amount

Second is a customer table with the folowing colums:

  • CustomerID
  • Name

This is very simplified example but the issue is the same. From_Customer and To_Customer shoulde relate to the Customers table.

In my QVW i have a chart where i want to display Income and Cost, obviusly the Income amount and Cost Total shoulde be equal when all customers are selected.

When i select one or more customers i want to see if i have more income than cost.

I hope it makes more seen if you view the QVW i have provided as an Attachment.

1 Solution

Accepted Solutions
Not applicable
Author

Invoice:

InvoiceID,

From_customer,

To_Customer,

Amount

     FROM Invoice;

customer :

LOAD

CustomerID AS From_customer,

CustomerID AS To_Customer,

Name

     FROM  customer;

View solution in original post

2 Replies
Not applicable
Author

Invoice:

InvoiceID,

From_customer,

To_Customer,

Amount

     FROM Invoice;

customer :

LOAD

CustomerID AS From_customer,

CustomerID AS To_Customer,

Name

     FROM  customer;

Not applicable
Author

This fixed the issue in regard to the two colums related to the same tabel, thanks. No i have to figure out out to count the Income vs Cost. Thanks for the help.