ThanksThis message has been edited. Last edited by: Shaun Lohman,
November 30, 2007, 01:01 PM
Leah
Shaun, are you new to the world of WebFOCUS?
Are you wanting to count across the years? Not knowing your file names or fields.
TABLE FILE COFFEESALE COUNT.ITEM BY DEPARTMENT BY CATEGORY BY SUBCATEGORY ACROSS YEAR ON TABLE PCHOLD EXL2K END
Also, please update your profile signature to show what version you are running.
Leah
November 30, 2007, 01:14 PM
Shaun Lohman
Thanks for the response. We are running 7.1.3.
The cacluation is actually a percentage. That part is not the problem. What I am having a problem with is displaying the total percentage for the coffee category, then display the percentages for the sub-cats within Coffe. Doing what you have suggested would give me,
WebFOCUS 7.1.3 Running on Linux Formats: Excel, PDF
November 30, 2007, 02:41 PM
Leah
The tool doesn't work that way, but if you were to play fancy work with computes and hold files you might be able to do what you want. I don't have any exampes, never saw a need for that way.
Of course there are others out their that may have the answer at their fingertips, but they are probably sleeping now as they are in European countries.
Of course perhapsdefinining a blank sub-cat field might work as well. Will play with one of the IBI 'play files' and see.
Leah
November 30, 2007, 03:37 PM
Victoria
Try summing the information separately and then matching and/or joining the information together. I had to use the CAR table to try to put together and example and then change to fields that would make sense for you...not sure it worked to well. I'm hoping you get the idea with the code below.
SET ASNAMES=ON
TABLE FILE COFFEESALE COUNT FIELD AS 'PERC1' AND COMPUTE SORT/A1 = 'A'; BY YEAR BY DEPT ON TABLE HOLD AS H001 END
TABLE FILE COFFEESALE COUNT FIELD AS 'PERC2' AND COMPUTE SORT/A1 = 'B'; BY YEAR BY DEPT BY CATEGORY ON TABLE HOLD AS H002 END
TABLE FILE COFFEESALE COUNT FIELD AS 'PERC3' AND COMPUTE SORT/A1 = 'C'; BY YEAR BY DEPT BY CATEGORY BY SUBCATEGORY ON TABLE HOLD AS H003 END
MATCH FILE H001 PRINT * BY SORT BY YEAR BY DEPT RUN
FILE H002 PRINT * BY SORT BY YEAR BY DEPT BY CATEGORY AFTER MATCH HOLD AS H005 OLD-OR-NEW RUN
FILE H003 PRINT * BY SORT BY YEAR BY DEPT BY CATEGORY BY SUBCATEGORY AFTER MATCH HOLD AS H005 OLD-OR-NEW END
DEFINE FILE H005 PERC/D7 = IF SORT EQ 'A' THEN PERC1 ELSE IF SORT EQ 'B' THEN PERC2 ELSE IF SORT EQ 'C' THEN PERC3 ELSE 0 END
TABLE FILE H005 SUM PERC BY DEPT BY CATEGORY BY SUBCATEGORY ACROSS YEAR END
Unfortunately it's much more complicated than it should be. If anyone knows an easier way, I'd love to see it!
Good luck,
Victoria
November 30, 2007, 04:08 PM
Shaun Lohman
wow, thanks for the response Victoria. I will have to try that on Monday. It looks like what I need! I will let you know how it turns out.
Thanks
WebFOCUS 7.1.3 Running on Linux Formats: Excel, PDF
December 04, 2007, 02:44 PM
Shaun Lohman
That did the trick.
Thanks Victoria
WebFOCUS 7.1.3 Running on Linux Formats: Excel, PDF