业务对象饼图难题 [英] Business Object Pie Chart Conundrum

查看:127
本文介绍了业务对象饼图难题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于业务对象(Launchpad 4.1 SP6)的限制,我需要构造一个饼图。很简单,但是我需要使用的数据集包含一个评估的代码字段,并且根据返回的字符串值,将另一个字段相加(由返回代码值描述的给定活动的累计分钟数)。

With the limitations of Business Objects (Launchpad 4.1 SP6), I need to construct a pie chart. Simple enough but the dataset I'm required to use contains a code field that is evaluated, and depending on the string value returned, another field is summed (accrued minutes of a given activity described by the return code value).

例如,[代码]返回 BRK1,表示中断并计算为15(表示15分钟)。另一个[代码]返回午餐,并评估为60(表示60分钟的午餐时间)。这些类型的代码返回减法代码,这意味着它们表示从计划工时中减去的时间。在同一[Code]字段中还包含描述工作段的代码。例如:[代码]返回 SB_PHN_SOUTH,表示换挡铲斗的结果为540分钟。排班时段是附加代码。

For instance [Code] returns "BRK1" meaning break and evaluating to a number 15 (indicating 15 minutes). Another [Code] returns "LUNCH" and evaluating to the number 60 (indicating a 60 minute lunch). These types of codes return "Subtractive Codes", meaning they represent time subtracted from Scheduled Work. Within the same [Code] field are also codes describing work segments. For example: [Code] returns "SB_PHN_SOUTH" indicating a "shift bucket" that evaluates to 540 minutes. The shift buckets are "Additive Codes".

因此,鉴于这些业务和程序规则,我有一个数据集,如下所示:

So, given these business and programmatic rules, I have a dataset that looks like this:

EWFMCodeSelect  EWFMPieChart
BREAK           2425685
DISC            443075
MISS            83476
NEUTR           2700
NODISC          582787
SHIFT           16120299

很容易变成饼图,但有一个主要错误。 BREAK,DISC,MISS,NEUTR和NODISC等所有组都属于Subractive,并且属于分子。代码SHIFT是分母。 SHIFT表示9小时的轮班时间,休息时间以及从轮班时间中减去的时间,因此精确的饼图会将每个减法桶显示为整个 SHIFT时间的百分比。

This can be easily turned into a pie chart but with one major error. All of the groups, BREAK, DISC, MISS, NEUTR and NODISC are all Subractive and belong in the numerator. The code SHIFT is the denominator. SHIFT represents 9 hours of shift time, breaks and such subtract from the shift time so an accurate pie chart would show each subtractive bucket as a percentage of the whole "SHIFT" time.

我有两个变量将值分组到存储桶中以进行求和和求和:

I have two variables to group values into buckets for evaluation and summation:

=If([Code]InList("BRK1"; "BRK2"; "BRK3"; "LUNCH" )) Then"BREAK"
ElseIf([Code]InList("TEAM"; "MTG"; "PROJ"; "TRNG")) Then "DISC"
ElseIf([Code]InList("LATE";"NOSHOW";"UNPAID";"UPVAC")) Then "MISS"
ElseIf([Code]InList("COACH")) Then "NEUTR"
ElseIf([Code]InList("VAC";"LOA";"SICKUP";"SICKPL")) Then "NODISC"
Else("SHIFT")

然后:

=If([EWFMCodeSelect]="BREAK") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))
ElseIf([EWFMCodeSelect]="DISC") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))
ElseIf([EWFMCodeSelect]="MISS") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))
ElseIf([EWFMCodeSelect]="NEUTR") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))
ElseIf([EWFMCodeSelect]="NODISC") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))
ElseIf([EWFMCodeSelect]="SHIFT") Then Sum([TimeDiff (ToInt)]ForEach([Clndr Date];[Time-Interval];[Agent Login];[Code]))



<我已经尝试了各种技巧来求和( SHIFT)-(InList(所有其他代码)),但是我遇到了#MULTIVALUE错误(无论我尝试了哪种上下文运算符)或某种其他类型的错误错误的返回值。

I've tried various techniques to Sum("SHIFT")-(InList("All other codes")) but I either get a #MULTIVALUE error (regardless of what Context Operators I've tried) or some other type of incorrect return value.

我在这里或其他地方没有发现描述类似问题(或解决方案)的帖子,所以我希望这里的一些Business Objects Webi专家可以建议

I've found no posts here or elsewhere describing a similar problem (or solution) so I'm hoping some fine Business Objects Webi expert here can suggest a path to solution.

谢谢您的考虑!

推荐答案

I would suggest working towards a standard tabular table to get the values you want, then convert it to a Pie Chart from there.

根据您的描述,我假设这些值您想在图表中看到的是:

Based on your description, I assume the values that you want to see in your chart are:

EWFMCodeSelect  
BREAK           15.0%
DISC             2.7%
MISS              .5%
NEUTR             .0%
NODISC           3.6%

此函数应该为您提供百分比:

This function should get you the percentages:

=[TimeDiff] 
/ NoFilter(( Sum([TimeDiff] 
                 ForAll([EWFMCodeSelect]) 
                 Where ([EWFMCodeSelect] = "SHIFT"))))

由于您不想要 [SHIFT] 的饼图,因此需要在该块上放置一个过滤器以排除它(<$ c $公式中的c> NoFilter()函数将 [SHIFT] 重新带回来进行评估)

Since you don't want a pie for [SHIFT], you will need to put a filter on the block to exclude it (The NoFilter() function in the formula brings [SHIFT] back in for evaluation)

这篇关于业务对象饼图难题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆