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     Looking for an easy way to do this:

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Looking for an easy way to do this:
 Login/Join
 
Gold member
posted
need to create an Excel speadsheet.
three sor columns with an across month year.

columns for the Across should be:

Jan 2008 Feb 2008 Mar 2008 April 2008 May 2007 June 2007 july 2007 Aug 2007 ...... Dec 2007

Now a staight across will give May 2007 June 2007 .....Dec 2007 Jan 2008 Feb 2008 .....April 2008

An ACROSS Month would give me Jan through Dec but I would loose the year.

Any sugestions

Thanks
Duane


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
 
Posts: 83 | Location: Princeton NJ | Registered: October 26, 2007Report This Post
Expert
posted Hide Post
Mr. Dgraff,

 -******************************************************************************************************
-* Rolling 12 months logic
-******************************************************************************************************
-SET &QT = '''';
-SET &BEG_YR   = DATECVT((DATEADD((DATECVT (&YYMD,   'I8YYMD', 'YYMD')),'M', -12)), 'YYMD','I8YYMD');
-SET &END_YR   = DATECVT((DATEADD((DATECVT (&BEG_YR, 'I8YYMD', 'YYMD')),'M',  11)), 'YYMD','I8YYMD');
-SET &LSTBOM   = DATECVT(DATEMOV(DATECVT(&BEG_YR, 'I8YYMD', 'YYMD'), 'BOM'),'YYMD', 'I8YYMD');
-SET &LSTEOM   = DATECVT(DATEMOV(DATECVT(&END_YR, 'I8YYMD', 'YYMD'), 'EOM'),'YYMD', 'I8YYMD');
-SET &FROMDATE = EDIT(&LSTBOM,'$$$$99/') | EDIT(&LSTBOM,'$$$$$$99/') | EDIT(&LSTBOM,'9999');
-SET &TODATE   = EDIT(&LSTEOM,'$$$$99/') | EDIT(&LSTEOM,'$$$$$$99/') | EDIT(&LSTEOM,'9999');
-SET &PGM_MO   = EDIT(&LSTBOM,'$$$$99');
-SET &PGM_YY   = EDIT(&LSTBOM,'9999');
-SET &XPGM_YY  = &PGM_YY + 1;
-SET &CNTR_MO  = &PGM_MO;
-SET &COLS     = 'COLUMNS ';
-SET &XCNTR    = 1;
-REPEAT MO_LOOP3 12 TIMES
-SET &MO_NAME = DECODE &CNTR_MO (
- 01 'Jan'
- 02 'Feb'
- 03 'Mar'
- 04 'Apr'
- 05 'May'
- 06 'Jun'
- 07 'Jul'
- 08 'Aug'
- 09 'Sep'
- 10 'Oct'
- 11 'Nov'
- 12 'Dec' ELSE 'XXX');
-SET &AND     = IF &XCNTR EQ 12 THEN ' ' ELSE ' AND ';
-SET &COLS    = &COLS | &QT | &MO_NAME | ' ' | &PGM_YY | &QT | ∧
-SET &XCNTR   = &XCNTR + 1;
-SET &CNTR_MO = IF &CNTR_MO EQ 12 THEN 1 ELSE &CNTR_MO + 1;
-SET &CNTR_MO = IF &CNTR_MO LE 9 THEN '0' | &CNTR_MO ELSE &CNTR_MO;
-SET &PGM_YY  = IF &CNTR_MO LT &PGM_MO THEN &XPGM_YY ELSE &PGM_YY;
-MO_LOOP3
-TYPE &COLS
-TYPE &BEG_YR TO &END_YR
-TYPE &LSTBOM TO &LSTEOM
-TYPE &FROMDATE TO &TODATE


Then, in the program, 

SQL SQLMSS SET SERVER XXXXXXXXXX
SQL SQLMSS PREPARE SQLOUTX FOR
SELECT
  a.COLUMN_NAME1,
  a.COLUMN_NAME2,
  a.COLUMN_NAME3,
  b.DATE_COLUMN,
  datename(month, b.DATE_COLUMN) as emonth
FROM
     DATABASE.dbo.TABLENAME a
JOIN DATABASE.dbo.TABLENAME b
   ON a.COLUMN_NAME = b.COLUMN_NAME
;
END
-RUN
?FF SQLOUTX
-RUN
-DO_RPT3
-******************************************************************************************************
DEFINE FILE SQLOUTX
  MON/A3         = EDIT(emonth, '999');
  XDATE1/YYMD    = HDATE(DATE_COLUMN,'YYMD');
  XDATE2/I8YYMD  = XDATE1;
  XDATE3/A8      = EDIT(XDATE2);
  MO_CCYY/A8     = MON | ' ' | EDIT(XDATE3,'9999');
END

TABLE FILE SQLOUTX
SUM
  COLUMN_NAME1
  COLUMN_NAME2
  COLUMN_NAME3
ACROSS MO_CCYY AS '' &COLS

etc.


Not easy, BUT, works OK... You can adjust the years as you see fit...

Have FUN!!!!

Tom

EDIT: Fixed the rolling year AND Gave a more complete example

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
If the across date is a smart date this works puts in a comma the version I used; Code from a table we have a date in.

DEFINE FILE MMAPTBL_UNO_PROD ADD
ADMIT/MtrYY=MM515;
END
TABLE FILE MMAPTBL_UNO_PROD
SUM
CNT.MM005_MMAP
ACROSS ADMIT
HEADING
""
FOOTING
""
WHERE ( MM301 EQ '20083' ) AND ( MM450 GT ' ' );


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Duane,
Maybe this is a bit late for you, but here is a simple solution. It is based upon the assumption that your file has dates that span 1 year only. The example is based on the CAR file. I created a fictitious date.
  
-* File dgraff.fex
DEFINE FILE CAR
PROD/DMYY=
63* 365 + LENGTH * 10 + HEIGHT * 10 + WIDTH * 10;
MPROD/MtYY=PROD;
M/M=MPROD;
END
TABLE FILE CAR
SUM SALES 
ACROSS M NOPRINT
ACROSS MPROD
WHERE MPROD FROM '07/1971' TO '06/1972'
END


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, 2006Report This Post
Virtuoso
posted Hide Post
Duane

an easy question, so many answers...

What you want if I translate your question well is that you want the lst year first and then the normal month sequence.
If your period is a normal smartdate you can do this.

DEFINE FILE XXX
YEAR/YY=YOURDATE;
MONTH=tM/YOURDATE;
YEARMND/YYtM=YOURDATE;
END
TABLE FILE XXX
SUM whatever
BY xxxx
ACROSS HIGHEST YEAR NOPRINT
ACROSS MONTH NOPRINT
ACROSS YEARMND
END


...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
duane -- see if this helps.
-* CASHFLOW is a sample ibi table
-***********************************************
-* get current month and year from system date
-SET &TODAY = &YYMD;
-SET &TODAY = '19980513';
-SET &CYR = EDIT(&TODAY,'9999$$$$');
-SET &CMO = EDIT(&TODAY,'$$$$99$$');
-SET &LYR = (&CYR - 1);
-***********************************************
DEFINE FILE CASHFLOW
CASHDATE/I8YYMD = CASH_DATE;
CASH_MM /A2 = EDIT(CASHDATE,'$$$$99$$');
CASH_YY /A4 = EDIT(CASHDATE,'9999$$$$');
SORT_DATE /A6 = IF CASH_MM LT '&CMO' THEN '&CYR' || CASH_MM ELSE
'&LYR' || CASH_MM;
END
TABLE FILE CASHFLOW
PRINT
LONG_TERM_DEBT
INTER_TERM_DEBT
SHRT_TERM_DEBT
ACROSS HIGHEST CASH_YY NOPRINT
ACROSS SORT_DATE
BY HIGHEST CASH_YY NOPRINT
BY SORT_DATE NOPRINT
BY CASH_DATE
WHERE CASH_DATE LT '05/01/1998';
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report 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     Looking for an easy way to do this:

Copyright © 1996-2020 Information Builders