Focal Point
[SOLVED] Stacked measures in a bar chart with aggregated total

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6777060096

May 01, 2018, 02:35 PM
LarissaB
[SOLVED] Stacked measures in a bar chart with aggregated total
Another chart question here!
I am trying to stack some fraud measures like March's potential Fraud and March's Actual Fraud, but I want to show the Actual fraud as part of the overall potential fraud, but have the data labels reflect exactly what the totals are and not a computation of potential fraud minus actual fraud so my overall stacked bar doesn't go above the potential fraud amount.

Example:
Potential Fraud for March = $100K (red)
Actual Fraud for March = $18K (purple)

I want to show the stacked data where both pieces of data cap out at $100K for an X axis, but the "red" section has a data label of $100K and the "blue" section has a data label of $18K. Right now, I continue to get the data capping out at $118K, it's combining the two sets of data for an overall total. It makes sense, that's exactly what I'm telling it to do, I just don't know how to reflect the pieces properly to not have an aggregate monthly total of the two combined and show the actual as part of the potential... Clear as mud right

Is that possible?

This message has been edited. Last edited by: LarissaB,


Version: 8.2.03M, OS/Platform: Windows 7 & 10, Output: Excel, pdf, html
May 02, 2018, 08:17 AM
MartinY
What you need to do is to compute the potential fraud left from the actual.
Consider the potential fraud as a "budget"

Something such as this. The Budget label will give you the remaining Budget value but the stack height will be the total of Budget and Sales
Note that BDG exist only to create situation where Sales are greater than Budget for my sample
TABLE FILE GGSALES
SUM COMPUTE BDG     /I8 = BUDDOLLARS - 10000; NOPRINT
    DOLLARS AS 'SALES'
    COMPUTE BUDGET /I8 = IF BDG LE DOLLARS THEN 0 ELSE BDG - DOLLARS;
BY PRODUCT
ON TABLE HOLD AS RPTDATA
END
-RUN

ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE RPTDATA
SUM
    SALES   AS 'Sales'
    BUDGET  AS 'Budget'
BY PRODUCT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "seriesLayout": "stacked"
},
"agnosticSettings": {
    "chartTypeFullName": "Bar_Stacked"
}
*END
ENDSTYLE
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 02, 2018, 04:41 PM
LarissaB
Thanks Martin, this approach got me very close to what I needed. I appreciated the response!


Version: 8.2.03M, OS/Platform: Windows 7 & 10, Output: Excel, pdf, html