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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
b_garside
Partner - Specialist
Partner - Specialist

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;

Labels (1)
1 Solution

Accepted Solutions
b_garside
Partner - Specialist
Partner - Specialist
Author

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

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Specialist
Partner - Specialist
Author

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
Partner - Specialist
Partner - Specialist
Author

Strange. no error but sorting did not occur?

MayilVahanan
MVP
MVP

Hi

Try like this

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

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
b_garside
Partner - Specialist
Partner - Specialist
Author

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