具有多个标准的 Salesforce 字段计算
我正在尝试提出一个公式,该公式将根据“入学队列城市”名称在“偏移字段”中进行计算。
由于某种原因,公式使用 100 减去所有行的记录数。
我目前的公式: IF(Placement__c.Enrollment__c.Cohort_City__c ="Online",RowCount - 100,RowCount - 45)
用最简单的术语来说,我需要根据多个条件从记录计数中减去偏移列。
纽约需要一个 45 减去“记录数”的公式,
在线效果很好。 100 减去记录数 = -89
纽约需要一个公式,将 46 减去“记录数”
I am trying to come up with a formula that will give a calculation in the "Offset Field" based on The "Enrollment Cohort City" name.
For some reason the formula is using 100 to minus record count for all rows.
My Current Formula:
IF(Placement__c.Enrollment__c.Cohort_City__c ="Online",RowCount - 100,RowCount - 45)
In the simplest terms I need to have the offset column subtract from the record count based on multiple conditions.
New York needs a formula that will be 45 minus "record count"
Online works fine. 100 minus record count = -89
New York needs a formula that will be 46 minus "record count"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常我会使用 CASE 函数,但是看起来它在汇总级别公式中表现得很有趣。要么只返回默认子句,要么抱怨类型不匹配。
尝试通过制作辅助行级公式来作弊。
这是我的标准“产品机会”报告,其中包含标准数据,您可以在 Developer Edition、Trailhead Playground、Scratch 组织(您知道,“伯灵顿纺织品”、“亚利桑那大学”、“联合石油天然气公司”等)中找到。按帐户结算城市分组(因此它应该符合您的情况,opp 订单项 -> opp -> 帐户)。
假装第一行显示“在线”
[
首先,我创建了名为“城市偏移量”的行级公式
类型 = 数字,小数点后 0 位。这就是我想要的
CASE
CASE(ADDRESS1_CITY,'Austin',100,'New York',46,45)
。当你对它进行分组时,SF很可能会显示该字段的SUM,我们不希望这样。要么根本不显示该字段,要么选择 AVG/MIN/MAX。我选择了 MAX,所以我的表格列标题显示“最大...”
一旦您对行级公式感到满意,请添加最终的汇总级计算。对我来说是
CDF1:MAX - RowCount
,您的字段名称可能有所不同。使其类似于:Normally I'd use CASE function but looks like it behaves funny in summary level formulas. Either returns just the default clause or complains about type mismatch.
Try to cheat by making a helper row-level formula.
Here's my standard "Opportunities with Products" report on standard data you can find in Developer Edition, Trailhead playground, scratch orgs (you know, "Burlington Textiles", "University of Arizona", "United Oil & Gas" etc). Grouped by Account billing city (so it should match your situation, opp line item -> opp -> account).
Pretend 1st row says "Online"
[
First I created row level formula called "city offset"
Type = number, 0 decimal places. So that's the
CASE
I wantedCASE(ADDRESS1_CITY,'Austin',100,'New York',46,45)
.When you group it SF is likely to display SUM of this field, we don't want that. Either don't display the field at all or pick AVG/MIN/MAX. I've went with MAX so my table column's header says "Largest..."
Once you're happy with the row-level formula add your final summary-level calculation. For me it was
CDF1:MAX - RowCount
, your field names may differ. Make it similar to this: