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.
With the CAR file, I can issue a simple multi-verb request, like so:
TABLE FILE CAR
SUM
SALES
BY COUNTRY
SUM
SALES
BY COUNTRY
BY CAR
END
I'm now experimenting with our first SQL Server Analysis Services 2012 cube, and I'm finding that I cannot do something comparable:
TABLE FILE CDW_DEMO
SUM
ORDER_AMOUNT
BY STATE
SUM
ORDER_AMOUNT
BY STATE
BY PRODUCT
END
When I do, I get the following error:
(FOC024) LIST OR PRINT MUST BE THE LAST VERB IN A MULTI-VERB REQUEST
Note that when I run each verb individually, commenting out the other verb, results are returned. I do find, however, that I CAN do this:
TABLE FILE CDW_DEMO
SUM
ORDER_AMOUNT WITHIN STATE AS 'ALL STATE'
ORDER_AMOUNT
BY STATE
BY PRODUCT
END
Was I violating some rule with the multi-verb approach against a cube? Is there a way to code this correctly, or should I look forward to re-thinking this (and other!) ingrained coding techniques?
Thanks!
CraigThis message has been edited. Last edited by: <Kathryn Henning>,
This is a known issue It is considered as a long term project.
The issues are complex with a cube such as SSAS as the aggregation should be done within the cube itself. Internally, against a SSAS Cube, a SUM is translated into a PRINT to ensure that non-aggregatable measures are not aggregated.
This also affects other aspects of reporting such as accordian reports and attempting to SUM on a DEFINE:
DEFINE FILE ADVENTURE_WORKS
D_MONTH/A3 = EDIT(Month,'999');
END
TABLE FILE ADVENTURE_WORKS
SUM Internet_Sales_Amount
BY D_MONTH
END
will produce multiple lines for each month as if a PRINT was coded.
However be aware of the reporting syntax that can be associated with SSAS cubes that can show the cube to its best advantage, like BY hierarchy_field HIERARCHY, SHOW TOP n etc. and the settings that can affect reporting such as SET ROLLUP_BY_VISUALTOTALS.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Thanks, Alan! (And Waz, I did turn on the trace, and the error I'm receiving presents itself and NO MDX code is displayed.)
And while I have your "ear," Alan, one other thing, please: How do I get the adapter to generate a synonym reflecting a parent/child relationship? Seems I'm getting a LEVEL hierarchy despite selecting parent/child in the "Present Parent/Child Hierarchies as" drop-down list. Is there something I should ask of my DBA??
Made a case out of this. Am looking at the suggested solution, substituting a MATCH for the two-step workaround I had fashioned. Here's some sample code:
MATCH FILE ADVENTURE_WORKS
SUM
INTERNET_SALES_AMOUNT AS INTERNET_SALES_AMOUNT_1
BY COUNTRY
RUN
FILE ADVENTURE_WORKS
SUM
INTERNET_SALES_AMOUNT AS INTERNET_SALES_AMOUNT_2
BY COUNTRY
BY STATE_PROVINCE
BY CITY
AFTER MATCH HOLD OLD-AND-NEW
END
TABLE FILE HOLD
SUM
INTERNET_SALES_AMOUNT_1 AS INTERNET_SALES_AMOUNT
BY COUNTRY
SUM
INTERNET_SALES_AMOUNT_2 AS INTERNET_SALES_AMOUNT
BY COUNTRY
BY STATE_PROVINCE
BY CITY
END
TABLE FILE HOLD SUM INTERNET_SALES_AMOUNT_1 AS INTERNET_SALES_AMOUNT BY COUNTRY SUM INTERNET_SALES_AMOUNT_2 AS INTERNET_SALES_AMOUNT BY COUNTRY BY STATE_PROVINCE BY CITY END
I believe you need to apply an appropriate data-reduction operator (MIN. or MAX. or AVE. will do) to INTERNET_SALES_AMOUNT_1 in the first SUM, to avoid multiplicative effect.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
TABLE FILE ADVENTURE_WORKS
SUM
Internet_Sales_Amount
BY Country
BY State_Province
BY City
ON TABLE HOLD
END
TABLE FILE HOLD
SUM
Internet_Sales_Amount
BY Country
SUM
Internet_Sales_Amount
BY Country
BY State_Province
BY City
END
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
My real problem is trying to (efficiently) create a Top n report on the cube, without benefit of multi-verb. Here's how I presented this in the case I opened:
With the CAR file, I can create a report of the Top n Countries with the highest total Retail Cost, showing the Car detail across:
TABLE FILE CAR
SUM
COMPUTE ROWTTL/D13=RETAIL_COST; NOPRINT
BY TOTAL HIGHEST 2 ROWTTL NOPRINT
BY COUNTRY
SUM
RETAIL_COST
BY TOTAL HIGHEST 2 ROWTTL NOPRINT
BY COUNTRY
ACROSS CAR AS ''
COMPUTE TOTAL/D13=C1;
ON TABLE SET HIDENULLACRS ON
END
The need for this kind of "Top n" reporting is common, and I'm wondering how best to approach it. As a workaround, I've done something like this:
TABLE FILE CAR
SUM
RETAIL_COST NOPRINT
BY TOTAL HIGHEST 2 RETAIL_COST NOPRINT
BY COUNTRY
ON TABLE SAVE
END
TABLE FILE CAR
SUM
RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY IN FILE SAVE
ON TABLE HOLD
END
TABLE FILE HOLD
SUM
COMPUTE ROWTTL/D13=RETAIL_COST; NOPRINT
BY TOTAL HIGHEST 2 ROWTTL NOPRINT
BY COUNTRY
SUM
RETAIL_COST
BY TOTAL HIGHEST 2 ROWTTL NOPRINT
BY COUNTRY
ACROSS CAR AS ''
COMPUTE TOTAL/D13=C1;
END
As you can see, this requires TWO passes at the data source, in this case one to get the COUNTRY list and one to get the detail data. If there's a better way, when hitting a cube, I'd like to see it!
Hi For TOP/LOW n reports there is a new feature in 7705 server for supporting TOPCOUNT and BOTTOMCOUNT MDX syntax: In the syntax you combine HIGHEST/LOWEST TOTAL and READLIMIT:
examples:
TABLE FILE ADVENTURE_WORKS SUM Internet_Standard_Product_Cost BY LOWEST TOTAL Internet_Standard_Product_Cost BY State_Province WHERE READLIMIT EQ 10 END
It will generate:
=== SSASET MDX statement generated: WITH SET H7 as ' [Customer].[Customer Geography].[State-Province].ALLMEMBERS' SELECT { [Measures].[Internet Standard Product Cost]} ON AXIS(0), NON EMPTY BOTTOMCOUNT(NONEMPTY(H7, [Measures].[Internet Standard Product Cost]), 10,[Measures].[Internet Standard Product Cost]) DIMENSION PROPERTIES MEMBER_CAPTION ON AXIS(1) FROM [Adventure Works]
and
TABLE FILE ADVENTURE_WORKS SUM Internet_Standard_Product_Cost BY HIGHEST TOTAL Internet_Standard_Product_Cost BY State_Province WHERE READLIMIT EQ 10 END
will generate:
=== SSASET MDX statement generated: WITH SET H7 as ' [Customer].[Customer Geography].[State-Province].ALLMEMBERS' SELECT { [Measures].[Internet Standard Product Cost]} ON AXIS(0), NON EMPTY TOPCOUNT(H7,10,[Measures].[Internet Standard Product Cost]) DIMENSIO MEMBER_CAPTION ON AXIS(1) FROM [Adventure Works]
I would use a solution in the following direction:
-* find top 5 state_province TABLE FILE ADVENTURE_WORKS SUM ADVENTURE_WORKS.ADVENTURE_WORKS.Internet_Gross_Profit BY TOTAL HIGHEST ADVENTURE_WORKS.ADVENTURE_WORKS.Internet_Gross_Profit BY ADVENTURE_WORKS.ADVENTURE_WORKS.State_Province WHERE READLIMIT EQ 5 ON TABLE HOLD AS GENDAT END -RUN
-* create a unique list for filtering TABLE FILE GENDAT BY State_Province ON TABLE HOLD AS AA FORMAT ALPHA END -RUN
-* retrieve final report all cities for top 5 state_provinces TABLE FILE ADVENTURE_WORKS SUM ADVENTURE_WORKS.ADVENTURE_WORKS.Internet_Gross_Profit BY ADVENTURE_WORKS.ADVENTURE_WORKS.State_Province BY ADVENTURE_WORKS.ADVENTURE_WORKS.City2
WHERE ADVENTURE_WORKS.ADVENTURE_WORKS.State_Province IN FILE AA
END -RUN
The MDX trace:
first part:
=== SSASET MDX statement generated: WITH SET H7 as ' [Customer].[Customer Geography].[State-Province].ALLMEMBERS' SELECT { [Measures].[Internet Gross Profit]} ON AXIS(0), NON EMPTY TOPCOUNT(H7,5,[Measures].[Internet Gross Profit]) DIMENSION PROPERTI MEMBER_CAPTION ON AXIS(1) FROM [Adventure Works]
second part:
=== SSASET Auxiliary MDX statement generated: SELECT {[Measures].ALLMEMBERS(0)} ON AXIS(0), HIERARCHIZE([Customer].[Customer Geography].[State-Province].ALLMEMBERS) DIMENSION PROPERTIES MEMBER_TYPE ,MEMBER_UNIQUE_NAME ,MEMBER_CAPTION ON AXIS(1) FROM [Adventure Works] === SSASET Filter list generated for multilevel test: [Customer].[Customer Geography].[All].&[Australia].&[NSW]&[AU], [Customer].[Customer Geography].[All].&[Australia].&[VIC]&[AU], [Customer].[Customer Geography].[All].&[United Kingdom].&[ENG]&[GB], [Customer].[Customer Geography].[All].&[United States].&[CA]&[US], [Customer].[Customer Geography].[All].&[United States].&[WA]&[US] === SSASET MDX statement generated: WITH SET H7 as ' {[Customer].[Customer Geography].[All].&[Australia].&[NSW]&[AU], [Customer].[Customer Geography].[All].&[Australia].&[VIC]&[AU], [Customer].[Customer Geography].[All].&[United Kingdom].&[ENG]&[GB], [Customer].[Customer Geography].[All].&[United States].&[CA]&[US], [Customer].[Customer Geography].[All].&[United States].&[WA]&[US]}' SET H78 as ' [Geography].[Geography].[City].ALLMEMBERS' SELECT { [Measures].[Internet Gross Profit]} ON AXIS(0), H78 DIMENSION PROPERTIES MEMBER_CAPTION ON AXIS(1), H7 DIMENSION PROPERTIES MEMBER_CAPTION ON AXIS(2) FROM [Adventure Works]
Yes! That's the workaround I implemented prior to opening a case, and I do get correct results. I'm concerned, however, with the performance of this. In "Phase I," where I'm building my SAVE file of the Top n Customer Numbers based on Order Amount, I get excellent performance, even when generating the top 100. In "Phase II," however, when I'm getting all the detail data... Well, I may as well just hit "Run" and go out to lunch! This may have something to do with our test environment, but I'm wanting to ensure I'm coding as efficiently as possible.
As I said, I've opened a case and have shared my (our!) workaround with IBI Tech Support with the hope that something can be done to speed up these queries. Yes, I may have to play with different ENGINE SSAS SET commands before this is all over, but I wanted to start with my coding approach. I'll report back any findings...
1. Its also interesting to know whether in a single MDX query its possible to achieve this type of query
2. regarding the time it takes to run the report, how much time does it take if you run the subsequent request (the detailed one ) on a single value? if its very fast then you could create a loop and call the SSAS cube 10 times,each time on a single value, then append the data with MORE its not an efficient way regarding the DB calls however it may prove much faster in this case
3. another idea is to change the approach to a drill down report so users will very quickly get their top 10 report and then click and drill down on a specific valueThis message has been edited. Last edited by: WF_IL,