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.
Is there any way to write a single statement to give me: |201201 |201202 |201203 |201201 |201202 |201203 |SALES |SALES |SALES |PERCENT |PERCENT |PERCENT Jims |10 |15 |11 |5% |10% |7% Bobs |14 |5 |3 |9% |2% |1% Andrews |20 |11 |17 |15% |7% |12%
While I could pivot the sales and percent columns and perform a nested ACROSS statement this would cause issues with number formats. I was hopeful there is a way to maintain the number formats.
Many many thanks for any help.
WebFOCUS 7.61 Win7 / Server2003 / Server2008
Posts: 10 | Location: Sydney, Australia | Registered: June 16, 2011
DEFINE FILE X <== starting with 9 rows
FIELD1/A12='SALES';
VALUE1/D12=SALES;
FIELD2/A12='PERCENT';
VALUE2/D12=PERCENT;
END
MATCH FILE X
SUM
FIELD1 AS FIELD
VALUE1 AS VALUE
BY SHOP
BY DATE
RUN
FILE X
SUM
FIELD2 AS FIELD
VALUE2 AS VALUE
BY SHOP
BY DATE
AFTER MATCH HOLD OLD-OR-NEW <== HOLD has 18 rows
END
DEFINE FILE HOLD
FMT/A8= DECODE FIELD ('SALES' 'D12' ELSE 'D12%'); <== dynamic format
END
TABLE FILE HOLD
SUM
VALUE/FMT AS ''
ACROSS HIGHEST FIELD NOPRINT <== sorting on FIELDS, to group the SALES rows followed by the PERCENT rows
ACROSS DATE AS '' <== and on date within that
ACROSS FIELD AS '' <== just to show SALES or PERCENT under date in each column
BY SHOP
END
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Assumption concerning the formats of your fields: SHOP/A12 DATE/A6 SALES/I6 PERCENT/I3%
Assumption concerning file RESULTS: there is 1 record per SHOP|DATE.
Proposed solution:
DEFINE FILE RESULTS
ASALES/A6=FPRINT(SALES, 'I6', 'A6');
APCT/A6=FPRINT(PERCENT, 'I5%', 'A6');
END
TABLE FILE RESULTS
PRINT ASALES APCT
BY SHOP BY DATE
ON TABLE SAVE AS HRESULTS
END
-RUN
EX -LINES 8 EDAPUT MASTER, HRESULTS, C, MEM
FILENAME=HRESULTS, SUFFIX=FIX
SEGNAME=HRESULTS, SEGTYPE=S0
FIELDNAME=SHOP, ALIAS=SHOP, USAGE=A12, ACTUAL=A12, $
FIELDNAME=DATE, ALIAS=DATE, USAGE=A6, ACTUAL=A6, $
SEGNAME=FIELDS, SEGTYPE=S0, PARENT=HRESULTS, OCCURS=VARIABLE
FIELDNAME=RESULT, ALIAS=RESULT, USAGE=A6, ACTUAL=A6, $
FIELDNAME=POS, ALIAS=ORDER, USAGE=I2, ACTUAL=I4, $
-RUN
DEFINE FILE HRESULTS
APOS/A8=IF POS EQ 1 THEN 'SALES' ELSE 'PERCENT';
END
TABLE FILE HRESULTS
SUM RESULT
BY SHOP
ACROSS POS NOPRINT
ACROSS DATE
ACROSS APOS
END
This message has been edited. Last edited by: Danny-SRL,
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006