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

Comparing two fields from two different table ?

Hi,

plz resolve the issue.

A:

LOAD "Amount" AS Customer_Amount,

     "Company Name",

    "Document Type",

   "Posting Date";

SQL SELECT "Amount",

    "Company Name",

    "Document Type",

    "Posting Date",

   FROM TestSqlDatabaseOne.dbo."Detailed Customer";

B:

Purchase:

LOAD "Amount" as Purchase_Amount,

    "Company Name",

    "Linked Sales Invoice",

    "Posting Date",

SQL SELECT "Amount",

    "Company Name",

    "Linked Sales Invoice",

    "Posting Date",

    "Shortcut Dimension 2 Code"

FROM TestSqlDatabaseOne.dbo."Purchase" Where [Linked Sales Invoice] <> ' ';

C:

LOAD "Company Name",

     Currency Code",

     "Relational Exch_ Rate Amount",

    "Starting Date";

SQL SELECT "Company Name",

    "Currency Code",

    "Relational Exch_ Rate Amount",

    "Starting Date"

FROM TestSqlDatabaseOne.dbo."Currency" where "Currency Code"='INR';

Condition :

1. if(Posting date=Starting date and Document type=2) then Sum(Amount)/Sum(Relational Exch_Rate Amount) in table A is sales

2. If(Posting date=Starting date and Linked Sales Invoice=Document no) then Sum(Amount)/Sum(Relational Exch_Rate Amount)  in table B is purchase

Relation: A.Document no=B.Linked Sales Invoice

A.Posting Date=B.Posting Date=C.Starting Date

4 Replies
kkkumar82
Specialist III
Specialist III

Hi Satish,

Based on the relations please alias the columns in the tables A, B,C and Observe in the table viewer if the tables are linked as per your relationships.

Please create a straight table as per this.

if not gettting please upload a sample qvw file.

Gysbert_Wassenaar

Please don't clutter this site with duplicate discussions: How to compare two fields from two different tables


talk is cheap, supply exceeds demand
Not applicable
Author

Its was done by mistake.

Gysbert ignore this time.

Not applicable
Author

it didn't work dear.

i will add sample.