Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] HDI get multiple verb queries to push sums to the DBMS?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] HDI get multiple verb queries to push sums to the DBMS?
 Login/Join
 
Guru
posted
I have the following query which gives me a very nice hold file with multiple sums for Dollars for Yrly, Qtrly, Mntly, a the selected day and order detail for that day. But I noticed that the SQL generated, does not have SUMS or GROUP BYs in it (see below). Which means I'm bringing a years worth of detail back to the report server, about 200k's worth, should only be around 5k to 10k rows of daily order detail.

The &PRIMARY_SORT could be Warehouse, GL Class, Item Class that kind of thing. Again, the code you see here, works, it just seems like if I could push the sums into the DBMS it would run a lot faster.

Any ideas?

 TABLE FILE SALESHISTORY

-* Yearly
SUM
ORDERED_DOLLARS   AS ORDERED_DOLLARS_Y
SHIPPED_DOLLARS   AS SHIPPED_DOLLARS_Y
CANCELD_DOLLARS   AS CANCELD_DOLLARS_Y
BY &PRIMARY_SORT_FIELD
BY PERYR

-* Quarterly
SUM
ORDERED_DOLLARS   AS ORDERED_DOLLARS_Q
SHIPPED_DOLLARS   AS SHIPPED_DOLLARS_Q
CANCELD_DOLLARS   AS CANCELD_DOLLARS_Q
BY &PRIMARY_SORT_FIELD
BY FISCAL_YR
BY FISCAL_QTR

-* Monthly
SUM
ORDERED_DOLLARS   AS ORDERED_DOLLARS_P
SHIPPED_DOLLARS   AS SHIPPED_DOLLARS_P
CANCELD_DOLLARS   AS CANCELD_DOLLARS_P
BY &PRIMARY_SORT_FIELD
BY FISCAL_YR
BY FISCAL_QTR
BY FISCAL_PER

-* Daily
SUM
ORDERED_DOLLARS   AS ORDERED_DOLLARS_D
SHIPPED_DOLLARS   AS SHIPPED_DOLLARS_D
CANCELD_DOLLARS   AS CANCELD_DOLLARS_D
ALPHA_NAME
ADDRESS NUMBER
ORDER_NUMBER
SHIPPED_TO
CATEGORY_CODE_20        
SUB_SECTION             
SALES_CATALOG_SECTION   

BY &PRIMARY_SORT_FIELD
BY FISCAL_YR
BY FISCAL_QTR
BY FISCAL_PER
BY ACTUAL_SHIP_DATE

WHERE ORDER_NUMBER            EQ '&ORDER_NUMBER';
WHERE CATEGORY_CODE_20        EQ '&CATEGORY_CODE_20';
WHERE SUB_SECTION             EQ '&SUB_SECTION';
WHERE ADDRESS_NUMBER          EQ  &ADDRESS_NUMBER;
WHERE SALES_CATALOG_SECTION   EQ '&SALES_CATALOG_SECTION';
WHERE FISCAL_YR               EQ  2011;
WHERE ACTUAL_SHIP_DATE        LE  DT('20110602 00:00:00');


ON TABLE HOLD 
END 


-* SQL TRACE

 SELECT T1."ORDERED_DOLLARS",T1."SHIPPED_DOLLARS",T1."CANCELD_DOLLARS",T1."CXCRRD",
 T1."SDSRP2",T1."E1ITMCLSSDESC",T1."SDADDJ",T1."SDAN8",
 T1."SDLITM",T1."MCRP20",T1."MCDL01",T1."SDUOM1",T1."SDDOCO",
 T1."IBMCU",T1."SDDSC1",T1."SDSRP1",T1."SDUOM4",T1."ABALPH",
 T1."E1GLCODEDESC",T1."CLYR",T1."CLPN",T1."CLFISQTR" FROM
 Sales.dbo.SalesHistory T1 WHERE (T1."ACTUAL_SHIP_DATE" <= '20110718
 00:00:00.000') AND (T1."FISCAL_YR" = 2011);

 

This message has been edited. Last edited by: Kerry,


WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL
 
Posts: 291 | Location: Greater Cincinnati  | Registered: May 11, 2005Report This Post
Virtuoso
posted Hide Post
Don, can you add this to your trace statements?
SET TRACEON=SQLAGGR//CLIENT


It would tell you why the AGGREGATION was not done.

I have not used multi-verb requests directly against the database so I'm not sure how iWay handles the SQL translation.

I can see from your statements that the *Yearly* SUM uses entirely different groupings from the ones used in the others (WAREHOUSE and PERYR are exclusive to this one); maybe this is impacting the ability to write one single SQL statement that would perform all those disparate aggregation/groupings in a single pass.

Also, your *Daily* piece is attempting to SUM fields that are not numeric (ALPHA_NAME, ADDRESS_NUMBER, etc.) and while this works perfectly with FOCUS files (the last instance of each value is retrieved), iWay is much pickier when translating this to SQL.

Try prefixing each of those non-numeric fields with MAX. to increase your chances of a proper SQL aggregation.

Obviously you know why your first SUM is so different from the rest, but if you could (at least for the sake of testing) change your Yearly piece to something like this:
SUM
ORDERED_DOLLARS   AS ORDERED_DOLLARS_Y
SHIPPED_DOLLARS   AS SHIPPED_DOLLARS_Y
CANCELD_DOLLARS   AS CANCELD_DOLLARS_Y
BY &PRIMARY_SORT_FIELD
BY FISCAL_YR


It would align better with the other segments and maybe iWay would be more forgiving this time.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
njsden,

Arggggg! such a simple fix and I know better.

Thanks for taking the time,

Don
 
Posts: 291 | Location: Greater Cincinnati  | Registered: May 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] HDI get multiple verb queries to push sums to the DBMS?

Copyright © 1996-2020 Information Builders