Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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,