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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script Load from SQL Qurey

Hi!

I really appreciate your help.

I have the following SQL query that works perfect on SQL Server Management studio:

select * from tbasicdata tbrd

join tLocations lmg on lmg.id = tbrd.map_id

where

H1 = 'internal'

and

tbrd.day >= DATEADD(dd, -7, GETDATE())

I'm trying to create a new table on the script called : "Activities" and to select * from the query above

for example:

Activities:

load *;

SQL select * from tbasicrawdata tbrd

join tLocationsMap lmg on lmg.id = tbrd.map_id

where

H1 = 'MCE.internal'

and

tbrd.day >= DATEADD(dd, -7, GETDATE());

But it didn't work. Can someone please advise????

Thanks!!

1 Reply
Clever_Anjos
Employee
Employee

"didn't work" means what? Error? Wrong Data?


I can see you have a column "id" into both tables, if you select * an error will be generated.

Always prevent yourself from select *

QlikView will thrown a "General Error" if your query return more than one column with same name

Always be explicit about what you are selecting

Load *;

SQL select Field1,Fieldb, from tbasicrawdata tbrd

join tLocationsMap lmg on lmg.id = tbrd.map_id

where

H1 = 'MCE.internal'

and

tbrd.day >= DATEADD(dd, -7, GETDATE());