Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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!

Tags (2)
8 Replies
mdmukramali
Not applicable

Re: Sql with an OLEDB connection - inner join

Dear ,

Please can you share the script.

so that it's easy to help u.

Thanks,

vijay_iitkgp
Not applicable

Re: Sql with an OLEDB connection - inner join

Can you please share sample code you are using

jontydkpi
Not applicable

Re: Sql with an OLEDB connection - inner join

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

Re: Sql with an OLEDB connection - inner join

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
Not applicable

Re: Sql with an OLEDB connection - inner join

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

Not applicable

Re: Sql with an OLEDB connection - inner join

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

vijay_iitkgp
Not applicable

Re: Sql with an OLEDB connection - inner join

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

Re: Sql with an OLEDB connection - inner join

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