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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.
Hello All I need to repeat a value for every row For example I have column called flda, it has a value , I need to repeat this value for all other rows in fldb example flda fldb row1 0001 45 row2 0002 0 row3 0003 0 row4 0004 0 ... row99 0099 0
in the above example I will need fldb with the value of 45 for all rows
ThanksThis message has been edited. Last edited by: FP Mod Chuck,
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
Posts: 134 | Location: USA | Registered: August 21, 2008
DEFINE FILE CAR
SRT/I1=0;
END
TABLE FILE CAR
PRINT SALES
COMPUTE FST/D12.2M = PARTITION_AGGR(SALES, SRT, B, C, FST);
BY SRT
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
ON TABLE SET PAGE NOLEAD
END
Thank You I tried that , for some reason it does not like
DEFINE FILE CAR
SRT/I1=0;
END
TABLE FILE CAR
PRINT SALES
COMPUTE FST/D12.2M = PARTITION_AGGR(SALES, SRT, -1, C, FST);
BY SRT
BY COUNTRY
WHERE COUNTRY EQ 'W GERMANY'
ON TABLE SET PAGE NOLEAD
END
0 ERROR AT OR NEAR LINE 9 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: C
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
Posts: 134 | Location: USA | Registered: August 21, 2008
i THINK THIS FEATURE IS NOT AVAILABLE IN 8.1.5m WHICH WE HAVE
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
Posts: 134 | Location: USA | Registered: August 21, 2008
If you don't have a need to partition by a BY field then you can set up a simple counter using LAST (you can then hide the counter with a NOPRINT). Then using IF...THEN logic you can bring down the values of the first line.
TABLE FILE GGSALES
PRINT
COMPUTE COUNTER/I4 = LAST COUNTER + 1; NOPRINT
COMPUTE flda/A4 = EDIT(COUNTER);
COMPUTE fldb/I11 = IF COUNTER EQ 1 THEN DOLLARS ELSE LAST fldb;
BY PCD NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, LINES-PER-PAGE=UNLIMITED, $
END
If you want to break it up between BY fields you can do that as well using LAST
TABLE FILE GGSALES
PRINT
COMPUTE PARTITION_NUM/I4 = IF PCD NE LAST PCD THEN PARTITION_NUM + 1 ELSE PARTITION_NUM;
COMPUTE PARTITION_ROW/I4 = IF PCD NE LAST PCD THEN 1 ELSE LAST PARTITION_ROW + 1;
COMPUTE FIRST_DOLLARS/I11 = IF PARTITION_ROW EQ 1 THEN DOLLARS ELSE LAST FIRST_DOLLARS;
COMPUTE RUNNING_TOTAL/I11 = IF PARTITION_ROW EQ 1 THEN DOLLARS ELSE LAST RUNNING_TOTAL + DOLLARS ;
BY PCD
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, LINES-PER-PAGE=UNLIMITED, $
END
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015