Query on G/L Entry including dimension value 4

Hugo4711
Member Posts: 6
Hi,
I want to list all g/L entries including dim4 value. In order to include entries without dimensions I select "Use Default Values if No Match". But when I filter on "Dimension Code=FILTER(KONCERN)" it kind of overrides "Use Default Values if No Match" and leaves me without entries without dimensions. Any advice on how to solve this?

I want to list all g/L entries including dim4 value. In order to include entries without dimensions I select "Use Default Values if No Match". But when I filter on "Dimension Code=FILTER(KONCERN)" it kind of overrides "Use Default Values if No Match" and leaves me without entries without dimensions. Any advice on how to solve this?

0
Best Answer
-
You cannot do that in Query I'm afraid.
The "Use Default Values if No Match" is an equivalent to LEFT JOINSELECT ... FROM "G/L Entry" LEFT JOIN Dimension Set Entry ON "Dimension Set Entry"."Dimension Set ID" = "Dimension Set Entry"."Dimension Set ID"
the LEFT JOIN will return always all the entries from "G/L Entry"
What you need is something like this:SELECT ... FROM "G/L Entry" INNER JOIN Dimension Set Entry ON ("G/L Entry" ."Dimension Set ID" = "Dimension Set Entry"."Dimension Set ID") OR ("G/L Entry" ."Dimension Set ID" = 0) // G/L Entry with NO dimensions
The latter is not possible to achieve in NAV Query
The workaround would be to use query with INNER JOIN, and combine in code its output with entries taken directly from G/L Entry table, filtered to "Dimension Set ID" = 0
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
You cannot do that in Query I'm afraid.
The "Use Default Values if No Match" is an equivalent to LEFT JOINSELECT ... FROM "G/L Entry" LEFT JOIN Dimension Set Entry ON "Dimension Set Entry"."Dimension Set ID" = "Dimension Set Entry"."Dimension Set ID"
the LEFT JOIN will return always all the entries from "G/L Entry"
What you need is something like this:SELECT ... FROM "G/L Entry" INNER JOIN Dimension Set Entry ON ("G/L Entry" ."Dimension Set ID" = "Dimension Set Entry"."Dimension Set ID") OR ("G/L Entry" ."Dimension Set ID" = 0) // G/L Entry with NO dimensions
The latter is not possible to achieve in NAV Query
The workaround would be to use query with INNER JOIN, and combine in code its output with entries taken directly from G/L Entry table, filtered to "Dimension Set ID" = 0
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
Thanx, Will try that and feed back.0
-
Thanx again, Testad successfully.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions