Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
chitemerere
Specialist
Specialist

OLEDB Read Failed Error

I have the following Script:

Screenshot 2017-08-20 17.50.15.png

When i  load the above script i get an OLEDB Read Failed error message.  What is wrong in the Script?

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

SQL Select

Branch,[Retail Pharmacy],[Script Number],

Count(Distinct [Script Number]) as Rx

from PharmaMarketAudit.dbo.tblDatawarehouseConsolodatedCleanStage

Group By

Branch,

[Retail Pharmacy],

[Script Number];

View solution in original post

13 Replies
antoniotiman
Master III
Master III

Hi Christopher,

[Script Number] field there is not in the Group By

Regards,

Antonio

sasiparupudi1
Master III
Master III

Try with a resident load than a preceeding load

Temp:

SQL Select Branch,

"Retail Pharmacy",

"Script Number"

From PharmaMarketAudit.dbo.tblDatawarehouseConsolodatedCleanStage;

Noconcatenate Load

Branch,

[Retail Pharmacy],

[Script Number]

Count(Distinct [Script Number]) as Rx

Resident Temp

Group By

Branch,

[Retail Pharmacy],

[Script Number];

Drop Table Temp;

gowthamram
Contributor
Contributor

Hi Christopher,


Do not use aggregation directly while loading the data. Probably it should be the reason for you to get the error.


First load the data and then use resident load while doing aggregation. Sasidhar has given the script in this thread. It should work for you to resolve the issue.


-GDK

chitemerere
Specialist
Specialist

Noted with thanks Antonio.  However the script takes forever to execute and i am having to force it to end

chitemerere
Specialist
Specialist

Thank you Sasidhar.  After loading the temp table, the script takes forever to execute the resident load and i am having to force it to quit without ending the script execution

chitemerere
Specialist
Specialist

Thanks Gowtham, please see my responses above

chitemerere
Specialist
Specialist

I did a distinct SQL SELECT in the temp table load and a straight count in the resident load to reduce the amount of memory use

antoniotiman
Master III
Master III

Christopher,

move Group by from LOAD to Select

This should be faster..

SQL Select

Branch,[Retail Pharmacy],[Script Number],

Count(Distinct [Script Number]) as Rx

Group By

Branch,

[Retail Pharmacy],

[Script Number]

from PharmaMarketAudit.dbo.tblDatawarehouseConsolodatedCleanStage ;

However, if You Group By [Script Number] then Count(Distinct [Script Number]) is always 1.

Perhaps remove DISTINCT from Count or remove [Script Number] from Select Fields List and from Group By.

mayuresh_d
Partner
Partner

as per me here group by is issue....

Please remove group by and load ..then take resident and then aggr value. else aggr in sql script don't agg in preceding load.