2013 Query on Multiple-Field Primary Key Table Problem

OldNavDogOldNavDog Member Posts: 88
edited 2013-10-22 in NAV Three Tier
Hi all!

I was trying to educate myself on the use of Query Objects in 2013, and have encountered a "curiosity".

Let me start by saying I was simply trying to come up with an "Example" Query; so no questions about "Why would you want this?", ok? :D

The basic goal of the Query was to provide a Dataset that showed the Count and Total Amount of Sales Shipments for each "Shipping Agent" and "Shipping Agent Services" Entry. The Shipping Agent was in the Shipping Headers, but the Count and Amount Totals were gleaned from the Shipping Lines. So the Heirarchy is "Shipping Agent" -> "Shipping Agent Services" -> "Sales Shipment Header" -> "Sales Shipment Line". There is also a "Full Join" to show the "Blank Shipper" entries (which are the bulk fo the entries in the CRONUS data, at least in the U.S. Version...).

So far, so good; but here's the problem: I have tried every manner of "Join" between the various levels of the Query (yes, I know that the Joins I have right now are sub-optimal; but I am getting desperate!); but no matter what (and in direct contrast with the actual data it is Querying against), and as you can see (attachment below), I get ZEROS for the "Count" and "Total" columns for everything but the first Shipping Agent (DHL) (and the "No Match" entry on top).

I have tried this both with "Shipping Agent Services" as the Top-most DataItem (3 DataItems), and in its present state, with "Shipping Agent" as the Top-most (4 DataItems). Neither changed the Query Result.

Note that I have not verified that data exists for the "OWN_LOG" or "UPS" Shippers; but I KNOW there are Records for "FEDEX" that SHOULD be being picked up by the Query, but are apparently not.

No, I have not gone to the special pain to look at the Dataset, sorry!

Since it is difficult to show multiple Property windows, and apparently I can't attach a text-exported object to a forum post, I am not sure how to show the "guts" of my Query, without posting the text of the Object right in this message (which most people hate). But here goes:
OBJECT Query 60003 Totals By Shipper Services1
{
  OBJECT-PROPERTIES
  {
    Date=10/16/13;
    Time=[ 5:11:14 PM];
    Modified=Yes;
    Version List=Temporary - Query Testing;
  }
  PROPERTIES
  {
  }
  ELEMENTS
  {
    { 1240070008;;DataItem;                  ;
               DataItemTable=Table291 }

    { 1240070009;1;Column;                   ;
               DataSource=Code }

    { 1240070010;1;Column;                   ;
               DataSource=Name }

    { 1240070000;1;DataItem;                 ;
               DataItemTable=Table5790;
               DataItemLink=Shipping Agent Code=Shipping_Agent.Code;
               DataItemLinkType=SQL Advanced Options;
               SQLJoinType=Full Outer Join }

    { 1240070001;2;Column;                   ;
               DataSource=Shipping Agent Code }

    { 1240070002;2;Column;Service_Code       ;
               DataSource=Code }

    { 1240070003;2;Column;                   ;
               DataSource=Description }

    { 1240070004;2;DataItem;                 ;
               DataItemTable=Table110;
               DataItemLink=Shipping Agent Code=Shipping_Agent_Services."Shipping Agent Code",
                            Shipping Agent Service Code=Shipping_Agent_Services.Code;
               DataItemLinkType=SQL Advanced Options;
               SQLJoinType=Full Outer Join }

    { 1240070005;3;Column;                   ;
               MethodType=Totals;
               Method=Count }

    { 1240070006;3;DataItem;                 ;
               DataItemTable=Table111;
               DataItemLink=Document No.=Sales_Shipment_Header."No.";
               DataItemLinkType=SQL Advanced Options;
               SQLJoinType=Full Outer Join }

    { 1240070007;4;Column;                   ;
               DataSource=Unit Price;
               MethodType=Totals;
               Method=Sum }

  }
  CODE
  {

    BEGIN
    END.
  }
}



So, any Ideas what might be going on?

Thanks In Advance!
Experience is what you get, when you don't get what you want. --Anon.
Sign In or Register to comment.