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     Generate Report with Accumalative Percent

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Generate Report with Accumalative Percent
 Login/Join
 
Platinum Member
posted
Dear Developers

i need your Assistance,
i try to generate HTML Report with Accumliative value of Perecent.

the report look like the following:-

- Across date--------------------
- Day 1 |||| Day 2 |
Name |Total | firstvalue | %| secoundValue |%
--------------------------------------
Divi | 100 | 20 |20%|80 |100%
Elin | 100 | 70 |70%|30 |100%

Note that the Accumilitive apllied on the % only not for the real value.Also if i have more than 2 Real Value let Say FirstValue,SecoundValue,ThirdValue....etc

i generate the same report using Excel template and it is OK becuase i use Excel functionality .


but can we do it with HTML

I Appreciate Your Assistance

Regards
Qalqili
 
Posts: 118 | Registered: February 08, 2006Report This Post
Platinum Member
posted Hide Post
I think its easier to do this by using a HOLD file to compute the percentages. Something like this..
table file data
sum value and compute cvalue=cvalue + value ; pct.cvalue WITHIN name
by name by date
on table HOLD
end
table file hold
sum value and cvalue across date by name
end


Release 7.6.9
Windows
HTML
 
Posts: 226 | Registered: June 08, 2003Report This Post
<JJI>
posted
Hello Qalqili,


The first step is you need to do is to make the total for each person for the periode you want to display in the report. Make sure the result is sorted by person and by date (in ascending order so the oldest date comes first). Put the result in a hold file.
In the second step you need to join the hold file to the file that contains the values per day for each person. After the files are joined you can calculate the % of the value against the total value.
To do this you need a Computed field to cumulate the values per person per day.
The first day of the period, the computed field will contain value1 , for second day it will contain value1+ value2,...., the last day it will contain the sum of all values for that person for that period. To do this you can compute the field like this:

Example:
COMPUTE TOTFIELD/D12.2= IF NAME NE LAST NAME THEN VALUE ELSE (TOTFIELD + VALUE);

Since you have the total value per person in each record per day and per person it is very easy to calculate the cumulative %:
Example:
COMPUTE PERC/D5.1%=((TOTFIELD/total value)*100)
Both fields are calculated per day and per person and put the result in a new hold file.

In the last step the only thing you need to do is the correct sorting.

TABLE FILE holdfile
PRINT
VALUE AS 'Whatever'
PERC AS %
BY NAME
BY TOTALVALUE_FIELD (this needs to be a BY-field since you only wants to see this once per line)
ACROSS DATE_FIELD
END

Test every step and check if your sorting is right, if your results are correct before you take the next step. For this solution I presumed you have only one value per person per day. If you have multiple values for the same day for the same person you will need to use the max.-prefix on the total value field in step 2 in order to make the calculations correct!!!!!

I'll hope this will help you.

Kind regards,

Dirk JJI
 
Report This Post
<JJI>
posted
Hello Qalqili,

I made a little mistake.

In the last fex
this line :
PERS AS % should be PERC AS '%'

I forgot the single quotes. Sorry for that.

Kind regards,

Dirk JJI
 
Report This Post
Platinum Member
posted Hide Post
Dear GeraldCohen/JJI

i will apply your technique and return back to you.


WF 7.7.0.3HF3 / WinXP- WF-Client & Apache / DevStd 7.7.0.3HF3 win XP.
 
Posts: 118 | Registered: February 08, 2006Report This Post
Platinum Member
posted Hide Post
Dear JJI/Gerald Cohen

i try your code it gives me some different from expected result.

but i modified some code and it is working fine with me.

here is the code:-
TABLE FILE SQLOUT
SUM
C_Counter AS 'Volum'
COMPUTE P2/D12.2% = ( D_Counter / C_Counter ) * 100; NOPRINT
AS 'Total %'
D_Counter NOPRINT
BY V1SND AS 'Sender'
BY V1RCV NOPRINT AS 'Receiver'
SUM
D_Counter AS '#'
COMPUTE SS/A2 = LAST V1SND; NOPRINT
COMPUTE Per/D12.2% = ( D_Counter / C_Counter ) * 100; NOPRINT AS '%'
COMPUTE Temp1/D12.2% = IF V1SND NE SS THEN 0.00 ELSE LAST Per; NOPRINT
COMPUTE Temp2/D12.2% = IF V1SND NE SS THEN 0.00 ELSE Per + Temp1; NOPRINT
COMPUTE Final/D12.2% = IF Temp1 EQ 0.00 AND Temp2 EQ 0.00 THEN ( Per + Temp2 ) ELSE ( IF LAST Temp2 EQ 0.00 AND LAST Temp1 EQ 0.00 THEN Per + Temp1 ELSE Per + LAST Final );
AS '%'
BY V1SND AS 'Sender'
BY V1RCV NOPRINT AS 'Receiver'
ACROSS HOUR1 AS 'Term of Hours'

ThanX very much for your Assistance


WF 7.7.0.3HF3 / WinXP- WF-Client & Apache / DevStd 7.7.0.3HF3 win XP.
 
Posts: 118 | Registered: February 08, 2006Report This Post
Expert
posted Hide Post
in 1 step
DEFINE FILE CAR
2SEATS/I8S=IF SEATS EQ 2 THEN SALES ELSE 0;
4SEATS/I8S=IF SEATS EQ 4 THEN SALES ELSE 0;
5SEATS/I8S=IF SEATS EQ 5 THEN SALES ELSE 0;
END
TABLE FILE CAR
SUM SALES NOPRINT BY CAR
SUM 2SEATS
AND COMPUTE SHARE2/D5S%=100*C2/C1;
4SEATS
AND COMPUTE SHARE4/D5S%=100*(C2+C4)/C1;
5SEATS
AND COMPUTE SHARE5/D5S%=100*(C2+C4+C6)/C1;
BY CAR

END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     Generate Report with Accumalative Percent

Copyright © 1996-2020 Information Builders