Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

b_garside
Valued Contributor

Syntax error, missing/misplaced FROM

Below is my script, but I keep getting this error. I'm sure its something simple. Maybe Im missing a , ; or keyword.

I'm trying to Sort my Project field and have to join with the Master table below. Is there a more efficient way to aplha order this field?

Syntax error, missing/misplaced FROM:

temp1:

Load Project Order by Project

temp1:

Load Project Order by Project

temp1:
Load Project Order by Project//Sorted project field for Master Join
SQL SELECT Project
FROM CorpReporting.MonthlyBacklogForecastMaster;

Join //Join Project field

ForecastMaster:
LOAD Autonumber(DataSetKey&'_'&Project) as %Key,     // Composite Join Key to ForecastRev
     DataSetKey,         

     Project,
    BacklogType,
Description,
EndUserCat,
FundedAmt,
Gate,
ItdRevenue,
MonthsLeftInPoP,
PWin,
TotalBacklogAmt;
SQL SELECT
DataSetKey,    

    Project,
Description,
BacklogType,
ContractedAmt,
EndUserCat,
PWin,
Gate,
ItdRevenue,
MonthsLeftInPoP,
TotalBacklogAmt
FROM CorpReporting.MonthlyBacklogForecastMaster;

1 Solution

Accepted Solutions
b_garside
Valued Contributor

Re: Syntax error, missing/misplaced FROM

Gysbert,

I used the script form your post and this worked great, not sure why it uses a QVD vs a Resident load at the end ?

Temp1:
LOAD Project;
SQL SELECT Project
FROM CorpReporting.MonthlyBacklogForecastMaster;

Temp2:
NoConcatenate
Load Project Resident Temp1 Order by Project;   //Sorted project field for Master Join
Store Temp2 into SortedProject.qvd;

Drop Table Temp1,Temp2;

ForecastMaster:
LOAD Project from SortedProject.qvd (qvd);

Join

LOAD

5 Replies

Re: Syntax error, missing/misplaced FROM

You can only use order by with resident loads, not with preceding loads. But you can simply let the sql database do the sorting for you:

ForecastMaster:

SQL SELECT Project
FROM WBB.CorpReporting.MonthlyBacklogForecastMaster

Order by Project;

join (ForecastMaster)

LOAD Autonumber(DataSetKey&'_'&Project) as %Key,     // Composite Join Key to ForecastRev
     DataSetKey,        

     Project,

...etc

edit: removed Temp table construction


talk is cheap, supply exceeds demand
b_garside
Valued Contributor

Re: Syntax error, missing/misplaced FROM

Ah ok, makes sense now. I wish they would have mentioned that in this artcile.

Thanks!

http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/04/preceding-load

b_garside
Valued Contributor

Re: Syntax error, missing/misplaced FROM

Strange. no error but sorting did not occur?

Re: Syntax error, missing/misplaced FROM

Hi

Try like this

Join the tables first. Then "order by project".

Hope it helps

b_garside
Valued Contributor

Re: Syntax error, missing/misplaced FROM

Gysbert,

I used the script form your post and this worked great, not sure why it uses a QVD vs a Resident load at the end ?

Temp1:
LOAD Project;
SQL SELECT Project
FROM CorpReporting.MonthlyBacklogForecastMaster;

Temp2:
NoConcatenate
Load Project Resident Temp1 Order by Project;   //Sorted project field for Master Join
Store Temp2 into SortedProject.qvd;

Drop Table Temp1,Temp2;

ForecastMaster:
LOAD Project from SortedProject.qvd (qvd);

Join

LOAD

Community Browser