Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to compare two fields from two different tables.

How to compare two fields from two different tables.

4 Replies
Mark_Little
Luminary
Luminary

Hi

Some more details would be helpful.

Normally you would need to join the tables and then compare if done in script.

But you could do in front end if you are using on a chart, with set analysis.

Mark

Not applicable
Author

In customer table,

where Document Type =2 then amount is sales_amount

In purchase table,

invoice = Document No in customer table then Amount in purchase table is purchase_amount

Not applicable
Author

     Purchase

Codeinvoice NoDateAmount
a1QA/00115/1/201045
b2SA/0028/2/201085
c3LA/0037/1/201195
a1NA/0053/5/201465
b2DA/00527/4/201515
c3BA/00519/3/201224
a1KA/0066/6/201372
b2ZA/00717/1/201538
a1EA/0087/8/201418
a1GA/00916/9/201591
b2HA/0105/9/201248
c3JA/0116/8/201346
a1WA/01224/03/201667
b2IA/01331/05/201592
c3TA/01423/05/201639

Customer Table

     

CodeDocument NoDocument TypeAmountDate
a1RA/0011101/1/2010
b2SA/0021202/2/2010
c3LA/0031301/1/2011
a1NA/0052505/5/2014
b2DA/00536010/4/2015
c3BA/0054709/3/2012
a1KA/0065806/6/2013
b2PA/0072908/1/2015
a1FA/0082457/8/2014
a1GA/0092656/9/2015
b2HA/0102824/9/2012
c3JA/0116156/8/2013
a1YA/01272425/03/2016
b2IA/01366230/05/2015
c3OA/01483421/05/2016
Mark_Little
Luminary
Luminary

HI,

If i am understanding correctly you could load both tables. then join the fields back you want to purchases,

So

Customer:

Load

     *

From Customers;

Purchases:

Load

     *

From purchases;

Left Join(Purchases)

Load

[Document No] as [invoice No]

Amount as [Sales Amount]

Resident Customer

Where [Document No] = 2;

Mark