Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

left join error syntax related

hi I have a query like below:

Master:

SQL SELECT

     a,

     n,

     c

from sometable

where (a='s' or a='p')   and year(n) >= year(CURRENT) -2;

Left join (Master)

......

Problem I am facing is that left join does not work it says table 'Master' not found. What I have realized is that error is comming from where statement after 'and' part.

If i cake out year(n) >= year(CURRENT) -2  then the left join works fine.

What could cause this?, how can i rewrite that statement so it wont thru error.

10 Replies
PrashantSangle

Hi,

Initially go with simple loading sql statement then create New Table using existing table and apply your condition on that and then apply left join on that table.

Like

SQL_Master:

SQL SELECT

     a,

     n,

     c,

Current     //ift this is field coming from SQL.

from sometable;

QLIK_MASTER

Load *

Resident SQL_Master

where   wildmatch(a,'s','p')  and year(n) >= year(AddMonths(CURRENT) -24);          //(a='s' or a='p') use wildmatch()

Drop table SQL_Master;

Left Join(Qlik_MASTER)

.......

.......

.......

Hope this will help you.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂