Discussion Board for collaboration on QlikView Scripting.
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:
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;
Go to Solution.
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
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:
SQL SELECT ProjectFROM WBB.CorpReporting.MonthlyBacklogForecastMaster
Order by Project;
LOAD Autonumber(DataSetKey&'_'&Project) as %Key, // Composite Join Key to ForecastRev DataSetKey,
edit: removed Temp table construction
Ah ok, makes sense now. I wish they would have mentioned that in this artcile.
Strange. no error but sorting did not occur?
Try like this
Join the tables first. Then "order by project".
Hope it helps