February 8, 2020
Is anyone familiar with what might be causing the following:
"We couldn't get data from an external data source. Please try again later. If the problem persists, please contact the administrator for the external data source. Here is the error message that was returned from the Analysis Server named [Expression.Error] We cannot convert the value null to type Logical.0:
I ONLY receive this error on occasion and it only comes up with a refresh outside PQ. Every single time I am in PQ, I never receive any type of error.
I can post the file if needed but looking for advice on what may cause this or ways within PQ to avoid this.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
February 8, 2020
I know. Agree with your assessment; I just cannot find it. And, it's not constant but upon auto refresh, I get the error, along with an occasional different expression.error. This only occurs when I am pulling data from a site (source) that is continuously updating.
I have attached the file for reference. There are seven queries where I am attempting an auto refresh every minute. These seven queries are pulling data from a site that updates data/stats based upon the current Major League baseball games going on (if not at the time, there typically is no issues) and brings the new data in the the "live" updates. The seven queries are as follows:
"LiveH2HScoresCondensed"
"LiveScores"
"LiveH2HPoints"
"LiveStandings"
"LiveRotoScore"
"LiveTotalPointsScore"
"LiveOPRScore"
I am not saying there are issues with each query. However, when these are checked for the one minute auto-refresh, I tend to receive the expression.error. My other queries work fine. I figured it was something with the source and the continuous updates; I was missing something there.
February 8, 2020
Before moving on, I thought I would see if there is anything else I can add to this to help me with my Expression.Error issues. It is difficult to pinpoint as they do not occur often. But, if I have the queries mentioned above set for an automatic update each minute, they will eventually occur.
My main goal was to share this file with others so they can view the updated standings/scores as they occur in real-time. With the Expression.Error issues, I am afraid to expose this to other users for viewing. Thanks.
Trusted Members
Moderators
November 1, 2018
There are quite a few places it could occur. For example, you have a lot of comparisons like if [Total] > 1 then which would cause that error if the Total field is null. A simple way around that is to use the coalesce operator if it is available to you, or just use an explicit comparison to true:
if [Total] > 1 = true then
since null = true will return false.
February 8, 2020
At first, I had the code different with some "null catches" and thought I had fixed what you were referencing above. Apparently not.
I am really interested in trying the coalesce operator. Is there anyway you could pick just one comparison, say from the "LiveH2HScoresCondensed" query and show me an example how this might work (if available on my end) using the coalesce operator? I could then see what you mean and apply to all the rest. Thanks.
1 Guest(s)