Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
naziralala
Creator
Creator

Garbage after statement error at script level

Hello All,

I am getting this error for the foll script:

[H1]:

Load Distinct] [VCode],

                     [ACode

From [PD.qvd](qvd)

where group='5'

Order by [ACode],[VCode] desc;

Can anybody point out the error?

Thanks in advance.

Nazira

4 Replies
lironbaram
Partner - Master III
Partner - Master III

you can't use order by when you load directly from qvd

you can only use it when you load resident tables

so you'll need to change the script

[H1Temp]:

Load Distinct] [VCode],

                     [ACode

From [PD.qvd](qvd)

where group='5';

[H1]:

noconcatenate load *

resident H1Temp

Order by [ACode],[VCode] desc;

drop table H1Temp;

tamilarasu
Champion
Champion

Try this. You wronlgly entered square bracket after distinct and there is missing bracket after ACode field. As said by Liron, you can't use Order By clause for qvd file. You can use only for resident table .

Temp:

Load Distinct  [VCode]

              ,[ACode]

From [PD.qvd] (qvd)

Where Group='5';

NoConcatenate

H1:

Load *

Resident Temp

Order BY [ACode],[VCode] Desc;

DROP Table Temp;

Kushal_Chawda

You can perform the Order by Operation on the data which is loaded into the memory. So order by only works on resident load

[H1]:

Load Distinct  [VCode],

                     [ACode

From [PD.qvd](qvd)

where group='5';

H2:

noconcatenate

load *

resident H1

Order by [ACode],[VCode] desc;

drop table H1;

Anonymous
Not applicable

Hi Nazirala,

According to Help:

"ORDER BY is a clause used for sorting the records of a Resident table before they are processed by the load statement."

The ORDER BY Statement orders data ASC/DESC,if order by is used for other than Resident load it might not order properly as it will be working as data is loaded.to work properly and order correctly,the whole data should be in memory.

[H1]:

Load Distinct [VCode],

                     [ACode]

From [PD.qvd](qvd)

where group='5';

[H2]:

Noconcatenate

Load Distinct [VCode],

                     [ACode]

Resident H1

Order by [ACode],[VCode] desc;

Drop Table H1;