Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
AndyE
Contributor II
Contributor II

Subquery in SQL Server gives "Field 'Id' not found" error

I'm connecting successfully to a Microsoft SQL Server database and am able to see results using simple join queries. When I add a subquery as a data field to a working join query, I get the error "Field 'Id' not found".

Actual samples below. Both samples work fine when using Visual Studio 2017 to run the same queries.
In Qlik, sample 1 works and sample 2 does not.
I saw posted somewhere that Qlik just passes the SQL directly through to SQL Server. However, the fact that I'm getting this error seems to indicate perhaps something more is going on.

Can anyone provide clues as to why this might be happening?
Thanks in advance.

Sample 1, working query:

 

[VerticalTraceView]:
SELECT Id,
                RunId,
                Name,
                Requirement.Name as ReqName,
                VerticalTrace.ToRequirementId,
                FilterResult
FROM RTM.dbo.Requirement as Requirement,RTM.dbo.VerticalTrace as VerticalTrace
WHERE Requirement.Id=VerticalTrace.FromRequirementId;

 

 

Sample 2, non-working, generates error on Load data:

 

[VerticalTraceView]:
SELECT Id,
                RunId,
                Name,
                (SELECT Requirement.Name from Requirement where Requirement.Id=VerticalTrace.ToRequirementId) as ReqName,
                VerticalTrace.FromRequirementId,
                FilterResult
FROM RTM.dbo.Requirement as Requirement,RTM.dbo.VerticalTrace as VerticalTrace
WHERE Requirement.Id=VerticalTrace.FromRequirementId;

 

 

Labels (1)
12 Replies
_ylc
Partner - Creator
Partner - Creator

I'm using QlikSense server (version Nov 2019).

rodneybarrett
Contributor II
Contributor II

Was there ever an answer to this.   I am now gettting the same Field 'id' not found when accessing the nprinting postgres database.  The id field is in the table plain as day.

rodneybarrett
Contributor II
Contributor II

nevermind.   mine was something else.   user error.  🙂