Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DestinedTale
Contributor II
Contributor II

Qlikview column ambiguously defined

Hi, i'm encountering below error when trying to left join same table with same column name at Qlikview load script for oracle sql. How can this be done? I have put T1 and T2 to identify the columns. 

TEST:
LOAD
A AS A;
SQL SELECT
T1."A"
FROM "TEST1" T1 left join "TEST1" T2 on T1."A" = T2."A"
where A ="test";

Labels (1)
6 Replies
Chanty4u
MVP
MVP

Try something like below

TEST:

LOAD

T1.A AS A1,

T2.A AS A2

FROM

(SELECT "A" FROM "TEST1" WHERE "A" = 'test') T1

LEFT JOIN

(SELECT "A" FROM "TEST1") T2

ON T1.A = T2.A;

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think you may need to add T1. in the where clause:

where T1.A ="test";

-Rob

DestinedTale
Contributor II
Contributor II
Author

here is the code. couldn't get it right  got the error sql command not properly ended. If i add the bracket as shown above, it will say missing right parenthesis.

FROM
"test1" WHRE To_Char(T1.bb, 'yyyymm') = $(vCurrentYearMonth) T1
LEFT JOIN SELECT "vsl" FROM "test" T2 on T1.vsl= T2.vsl;

DestinedTale
Contributor II
Contributor II
Author

here is the code. couldn't get it right  got the error sql command not properly ended. If i add the bracket as shown above, it will say missing right parenthesis.

FROM
"test1" WHRE To_Char(T1.bb, 'yyyymm') = $(vCurrentYearMonth) T1
LEFT JOIN SELECT "vsl" FROM "test" T2 on T1.vsl= T2.vsl;

DestinedTale
Contributor II
Contributor II
Author

sorry, ive updated to include full syntax. i have the sql syntax 

LOAD
A as A,
SQL (SELECT "A" FROM "vsl"

WHRE To_Char(T1.B, 'yyyymm') = $(vCurrentYearMonth) T1

LEFT JOIN SELECT "vsl" FROM "vsl" T2 on T1.A = T2.A;

Chanty4u
MVP
MVP

Try this 

LOAD A as A

FROM

SQL (

SELECT "A" FROM "vsl"

WHERE To_Char(T1.B, 'yyyymm') = $(vCurrentYearMonth)

LEFT JOIN

SELECT "vsl" FROM "vsl" T2 on T1.A = T2.A

);