Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sql with an OLEDB connection - inner join

Hello,

I'm kind of new on Qlikview an I'm getting problems joining two tables. I have a table with my customer and another table with the differents bills. Each of the table have a column with the customer's code but these two columns have different names. I tried renaming both columns with the same name. It works for the first table, but Qlikview tells me it's imposible for the second one since the name is already taken.

I tried joining the tables in the sql querry like I would do it on  website, but nothing works even a simple querry "where" or "group" by"...

Can someone helps me?

Thank you very much!

8 Replies
mdmukramali
Specialist III
Specialist III

Dear ,

Please can you share the script.

so that it's easy to help u.

Thanks,

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Can you please share sample code you are using

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I assume that you mean you are using the rename field command. For your scenario, rather uses aliasing during the load, something like:

     for first source:

          SQL SELECT ...

               Cust_Code As CustCode,

               ...

     for second source:

          SQL SELECT ...

               [CUSTOMER CODE] As CustCode,

               ...

Now the fields have the same name and will associate correctly.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

SQL SELECT

     FO_REFERENCE,

     FC_CCLIENT

FROM FC_REFERENCES

INNERJOIN FD_ENTETE_DEVI

ON FC_REFERENCES.FO_REFERENCE=FD_ENTETE_DEVI.FC_CCLIENT

WHERE FO_REFERENCE="HW";

vijay_iitkgp
Partner - Specialist
Partner - Specialist

TableA:        SQL SELECT ...               Cust_Code As CustCode,               ...; Inner Join (TableA)             SQL SELECT ...               [CUSTOMER CODE] As CustCode, .. ;

Not applicable
Author

Even when I'm using an alias, it says there is an error 😕

vijay_iitkgp
Partner - Specialist
Partner - Specialist

You can also use: TableA:        Load *, Cust_Code As CustCode; SQL SELECT * From ABC; InnerJoin(TableA) Load *, [CUSTOMER CODE] As CustCode; SQL SELECT * From DEF;

Not applicable
Author

So I tried this method and here is my code:

Test:

SQL SELECT

  ENDV_CCLIENT AS CodeClient

FROM FD_ENTETE_DEVI

;

inner join (Test)

SQL SELECT

  FO_REFERENCE AS CodeClient

FROM FC_REFERENCES;

And this the error message I get:

ErrorSource: (null), ErrorMsg: (null)

Test:

SQL SELECT

  ENDV_CCLIENT AS CodeClient

FROM FD_ENTETE_DEVI

Table introuvable

inner join (Test)

SQL SELECT

  FO_REFERENCE AS CodeClient

FROM FC_REFERENCES