Suite | Professional, Enterprise, or Enterprise Plus |
Support with | Explore Professional or Enterprise |
您可以创建自定义指标和属性用于报告,以便以所需的方式显示业务数据。为此,您需要了解如何编写公式。公式可对数据进行比较、计算和操作,并帮助您评估条件。
有关公式的更多信息,请参阅公式编写资源。
了解 Explore 公式
公式通常由两部分组成:
- 包含您 Zendesk 信息的指标和属性
- 对这些指标和属性执行操作的函数
Explore 中的公式从左到右读取,遵循数学运算顺序。一个公式可以包含多个语句,每个语句都包含指标、属性和函数,用于定义正在查找的数据。
在公式中,函数(例如 IF/THEN)通常和代数一样包含在括号 ()
中,不会影响公式的其余部分。如果公式只有一个函数,则可能不需要括号。
指标和属性名称包含在方括号 []
中。以文本字符串表示的指标和属性值包含在引号中,并必须与值完全匹配。例如,“End-user”和“end user”是两个不同的值。(有关公式中属性值的更多信息,请参阅如何查找属性值?)运算符用于连接属性名称和值,或执行其他计算。
总之,简单公式可能如下所示:
创建公式
了解 Explore 公式由指标、属性和函数组成后,接下来您将了解如何创建上述示例公式。
写下公式的逻辑有助于创建公式并找到所需的适当函数。本例中,公式流程为“如果工单渠道是电邮,请显示工单 ID”。稍后可知,这与我们最终得到的公式非常相似。
创建显示来自电邮渠道的工单的公式
- 在 Explore 中,创建新报告或打开现有报告进行编辑。
- 打开“计算”菜单 (
)。
重要提示:如果两个编辑者在同一个数据集中创建或编辑不同的报告,则只有第一个打开报告的人可以访问“计算”菜单。另一个编辑者将看到消息“此资源已锁定,因为当前它正在被<姓名>编辑”。等第一个人关闭报告后,下一个编辑者才可以使用“计算”菜单。 - 单击标准计算属性。随即打开新的空白属性。
- 为属性输入一个名称,例如通过电邮收到的工单。
- 在公式窗口中输入公式。有多种方法可以做到这一点,但现在,请单击函数下的添加。
- 搜索 IF THEN ELSE 条件表达式。使用搜索框,单击筛选将值缩小到 Logical 类别,或滚动列表直到找到所需的函数。
- 单击 IF THEN ELSE 条件表达式旁的 +。
Explore 随即会在窗口中添加一个 IF THEN ELSE 公式模板。其中以蓝色显示的值(以 _ 字符开头)是占位符,必须替换为所需的值。
提示:请注意公式上方标有 () 的错误消息。这表示存在问题以及问题在公式中的位置。现在,该错误可忽略。出现该错误是因为公式仍在使用占位符。
- 接下来,请将 _boolean_condition 替换为要测试的 Explore 属性。突出显示 _boolean_condition,然后从字段菜单中选择工单渠道,或手动修改公式以添加属性。
- 现在,添加其余条件。要搜索字符串“电邮”,请将其添加到现有条件中。
公式现在应为 IF ([Ticket channel]="Email") THEN _value_if_true ELSE _value_if_false ENDIF
- 接下来,添加要在条件为 true 时执行的操作,本例中即返回工单 ID。将 _value_if_true 替换为 [工单 ID]。请注意,输入 [工单 ID] 时,Explore 会自动根据输入的内容推荐匹配项。如果显示了所需的指标或属性,按下回车键即可完成输入。
- 工单模板中显示的 ELSE 子句可提供替代操作,用于第一个条件不为 true 时。本例中不需要该子句,因此请移除 ELSE _value_if_false。
- 您现已完成公式。如果一切正常,您将看到类似于以下屏幕的内容。此外,请注意,错误已消失,取而代之的是一个绿色勾号标记,表示公式有效。
- 最后,单击保存。您创建的属性现在可供使用相同数据集的任意 Explore 报告访问。要找到该属性,请在任意属性面板中单击添加并展开计算属性。
将指标和属性添加到公式中
使用 Explore 编写的大多数公式都可能使用当前使用的数据集中的指标或属性。在上例中,使用了属性工单渠道,但还有数百个属性可供选择。
对此,您可能会觉得无从下手,但这些指标和属性大多都有描述性名称,可帮助您找到所需的内容。此外,您还可以尝试在 Explore 中创建基本报告,深入了解各种指标和属性的作用。
在了解 Explore 数据集中可以找到所有可用指标和属性的完整列表。
将指标或属性添加到公式中
- 在 Explore 公式窗口中,单击选择字段。
- 滚动列表,或输入所需指标或属性的前几个字母,以筛选列表。
- 单击所需的指标或属性以将其添加到公式中。本例中,已选择“工单 ID”。请注意它是如何加上方括号 [] 的。
方括号向 Explore 表明这是一个指标或属性。您也可以直接输入指标或属性。Explore 可识别括号,并建议适当的值以供选择。
要将聚合器添加到指标或属性中,请在第一个括号前输入大写文本,例如 COUNT[工单 ID]。
将函数添加到公式中
要将函数添加到公式中,请单击函数下的添加,或输入函数名称。与指标和属性一样,Explore 会为您输入的任何函数建议自动完成结果。
单击添加后,函数窗口随即打开。如果您不确定哪个函数适用于要创建的计算元素,此窗口会很有用。窗口中所有功能都含有其用途的简要说明。有关所有函数的列表和相关示例,请参阅 Explore 函数参考。
如果您正在查找特定函数,可以搜索函数或按函数类型进行筛选。
- 在函数窗口中,单击筛选。
- 输入或从下拉列表中选择一个类别。
- 单击类别名称旁的 x 可移除筛选。
在公式中添加评论
您可以在公式中添加评论,说明其工作方式。如果您想与其他用户就公式进行协作,或者您想为自己做笔记,说明为什么要这样构建公式,评论将大有帮助。
在公式中添加评论的步骤
- 在公式中找到要插入评论的位置。
- 键入一个正斜杠和一个星号 (/*),再键入您的评论,然后键入一个星号和一个正斜杠 (*/)。警告:单击格式可移除所有评论。如果您单击了格式并想恢复您的评论,单击面板外的任何地方以关闭面板而不保存更改。
47 条评论
Jerina Hall
Hi - I am trying to create an end user submitted tickets forecast but remove tickets from the results that contain specific tags. When I try to do it by creating standard calculated metrics IF (NOT INCLUDES_ANY([Ticket tags], "tag1")) THEN [Ticket ID] ENDIF what I end up with is lots of different lines but what I am trying to achieve is one line indicating the values each year exluding the specific tags. Can anyone advise? Many thanks, Jerina
0
Zaffar Sayed
Hello,
I’m trying to create a custom attribute to capture tickets created in the week before the last (i.e., two weeks ago). Could someone please assist me with the formula for this?
0
Nikolay Atanasov
Hey,
I am building a report that tracks how many accounts we closed over a set period of time. I've filtered it by ‘Assignee name/role’ and ‘Ticket channel’.
However, I'm struggling with filtering out tickets that have only internal comments. I want the results to show only tickets with public or both public and internal comments.
Is there a way to build such formula?
Thanks!
0
James G
I suggest creating a test report using "Sos Requester Region" as the only attribute so you could see the actual attribute values that would show up if it is really "NAR (US)" and "NAR (CA)". Once you confirm that it is really the case, try creating a simpler formula like this -
and see if it works properly. If not, feel free to send us a ticket so we can take a better look - Contacting Zendesk Customer Support.
0
Thomas Lang
I am trying to create a formula that will track anytime someone changes the form field to something specific: Here is my formula, but I believe the changes value requires API, anyway to do this in explore wihout it?
IF ([Changes - Field name]] = "Ticket Form" AND [Changes - Previous value] != "Ticket Form 1" AND [Changes - New value] = "Ticket form 1") THEN [Update ticket ID] ENDIF
0
Dane
0
Bruce Willis
Hi Dane,
thank you for your support.
I would need to create a pie chart of all of the tickets created by specific users showing the allocation between all the available forms on the account.
Those users should be defined by the fact that they created at least one ticket by sending an email to a specific email address let's call it EMAIL1. Please note that the pie chart should show all of the tickets created by those users, not restricted to only the tickets created via that specific email address (sent via EMAIL2, forms, answer bot etc).
Thank you very much!
Aaron
0
Dane
I think you can use the attributes ticket form, ticket email address. However, I'm not aware on how you want it to be shown on your query. Hence I cannot provide a recommendation on how to write the formula. If you can give me an overview, I'll try to create one for you.
0
Devika
Hi! How can you for example calculate the percentage of 1 particular topic compared to the total amount of tickets for example?
0
Bruce Willis
Hi,
I'm trying to create a statistic regarding the behaviour of users in a specific workflow, but I can't seem to combine the logic correctly.
I need to filter the users that created tickets sending an email to a specific address, and to create a chart showing the allocation of ALL OF THEIR OTHER TICKETS between all the forms when they were submitting tickets (ie: understand which form is generating more complaint emails).
Thanks!
0
登录再写评论。