[DataFormat.Error] We cannot return the data produced by this query because of its complexity.

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,907
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a query in Power query, which loads to a Table in a worksheet.

The query is a very simple:
Code:
select * from db.view where order_number = '4100278642' order by order_date

There are no subsequent steps whatsover.

The query retruns 3 date columns and 11 decimal columns.

I have done some diagnostics and profiling, and even eyeballing the data, the result set contains no errors. Three of the decimal columns have nulls, otherwise there are no further nulls.

It is returning 231 results.

I get this error when trying to load the results to the Table in the worksheet: [DataFormat.Error] We cannot return the data produced by this query because of its complexity.

I have found a fix. I have removed errors across all columns (new step). This avoids the error at load. However it still returns 231 results. I think this is odd because this, along with profiling, suggests that there are no errors.

Has anyone encountered this, and can you explain this behaviour?

Many thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hello, Jon

I believe it is likely the first thing you did but is there a chance that you didn't already test the returned data by editing the SQL to return the individual fields from the view to see which field it starts to complain about?

SQL:
select order_number from db.view where order_number = '4100278642' order by order_date;
select order_date from db.view where order_number = '4100278642' order by order_date;
select order_number, order_date from db.view where order_number = '4100278642' order by order_date;
...
 
Upvote 0
Solution
Hello, Jon

I believe it is likely the first thing you did but is there a chance that you didn't already test the returned data by editing the SQL to return the individual fields from the view to see which field it starts to complain about?

SQL:
select order_number from db.view where order_number = '4100278642' order by order_date;
select order_date from db.view where order_number = '4100278642' order by order_date;
select order_number, order_date from db.view where order_number = '4100278642' order by order_date;
...
Hi Suat

No I didn't think to do that. Fabulous idea. I'm going to test that today if I can.

Big thanks!
 
Upvote 0
You solution just helped reinforce that the data is fine. :LOL:

I honestly don't know what is causing the error. I have a solution in that I remove errors, yet it removes nothing but at least allows me to drop the data.

This is just one of those that I am putting down to a phantom quirk.
 
Upvote 0
Hey Jon, I just hit the same issue albeit completely different cause (and resolution) but this is the ONLY thread I can find on the topic so, figured I'd update in case anyone should hit same error

my problem (seemingly) stemmed from a failure on my part to drop some temp tables used in my PQ SQL call -- so, I added these to my script and error was resolved.
in addition, the error was obviously manifesting in the PQ script used to pull the data from SQL Server and not in the (final) download PQ query which was generating the error
all in all, a few hours wasted chasing this down - c/o woeful error messaging on part of MS, and some terrible code on my part!

Luke
 
Upvote 0

Forum statistics

Threads
1,223,398
Messages
6,171,879
Members
452,429
Latest member
simransonu08

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top