--- title: "Customer Categorization with Case Expression Formula field" slug: "customer-categorization-with-case-expression-formula-field" updated: 2026-11-27T13:56:56Z published: 2026-11-27T13:56:56Z canonical: "support.gainsight.com/customer-categorization-with-case-expression-formula-field" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # Customer Categorization with Case Expression Formula field Gainsight NXT This article supports Gainsight NXT, the next evolution of the Customer Success platform. If you are using Gainsight CS Salesforce Edition, you can find supporting documentation by visiting the home page, and selecting CS > Salesforce Edition. Not sure what your team is using? Click [here](/docs/ja/customer-categorization-with-case-expression-formula-field#). 重要 - 画像/情報は四半期ごとのリリースで更新されます! 四半期ごとのリリースにて、最新の機能・情報を反映し、画像を含めた情報は更新されます。 This article explains how to use the Case expression formula field in Rules engine. Gainsight recommends that you refer to the [*Case Expression*](/v1/docs/ja/formula-fields-in-rules-engine#Case_Expression) section of the Formula Fields in Rules Engine article and then proceed with this article. ## Overview The Case Expression feature in Rules Engine allows you to categorize your data based on various parameters. This feature is reminiscent of the [*Switch Statement*](https://www.geeksforgeeks.org/switch-statement-in-java/) used in various programming languages. This article explains a specific use case in which you can use the Case expression feature to categorize your customers based on the revenue generated by them. Consider a situation in which you wish to categorize all your customers into Platinum, Gold, Silver and Bronze, based on the revenue generated by the customers. You can easily accomplish this task with the Case Expression. You can create four cases in Case Expression. The requirements for a Customer to be categorized as Platinum can be mentioned in the first case, Gold requirements can be specified in the second case and so on. ![M1.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M1(1).png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=Q8nFSGueRfCjT9vIyIPnek70sAweBjW%2B9guQOQ8edFY%3D) ## Assumptions - The Company object has a custom field called Account Name. This field stores all the names of the customers. - If the MRR of a customer is greater than 4000, the customer is considered to be a Platinum customer. - If the MRR of a customer is between 3000 and 3999, the customer is considered to be a Gold customer. - If the MRR of a customer is between 2000 and 2999, the customer is considered to be a Silver customer. - If the MRR of a customer is less than 2000, the customer is considered to be a Bronze customer. ## Create Dataset To Create Dataset: 1. Navigate to **Administration > Rules Engine**. 2. Click **Create Rule**. The New Rule window is displayed. 3. Enter the following details. 1. Enter a name in the **Rule Name** field. 2. *(Optional)* Select a folder for the rule. 3. (Optional) Enter a description for the rule. 4. Click **NEXT**. ![M2.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M2(1).png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=Ox7x41kUtDrZDD7pMqDX%2FotPGYurJT8rkfrrV%2BVtuOs%3D) 5. Click **DATASET** 6. Select **Company** as the source object. ![M3.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M3(1).png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=GrHDXtNelV24gY9p1GqhKPL7JeWf1eWC%2F3Af%2BvQe5p8%3D) 7. Drag and drop **Account Name** and **MRR** fields to the Show section. 8. Click **Save**. 9. Click <-. ![M4.GIF](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M4(1).GIF?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=8eTZUAXocOWOG3ZqJh%2FYRsvDjDQfzKZ1WtsCYkyI%2BLc%3D) ## **Create Transformation Task** To Create Transformation Task: 1. Click **+ TASK** and select **Transformation**. 2. Enter a name for the task in the **Task Name** field. 3. Select the Source Dataset (here it is *Fetch from Company*). ![M5.GIF](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M5(1).GIF?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=FMQm09sgt1FqikIKL1IOex4bgEV7ZWvAV3OP6imzXn0%3D) 4. Drag and drop **Account Name** to the Show section. 5. Drag and drop **Case Expression** to the Show section. ![M6.GIF](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M6(1).GIF?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=Oqx2EwzPtI4py11puFolnhbDB9s2A5cVDDSJmbomgFc%3D) ## Configure Case Expression To Configure Case Expression: 1. Enter **Customer Type** as the Output Field Label. 2. Select **String** as the **Output Data Type**. 3. Select: 1. **MRR** field 2. **>=** operator 3. **Value** 4. **4000** This is the criteria for Platinum customers. If the MRR > 4000, the customer is considered to be Platinum. ![1.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/1-6SZHZFOK.png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=RCW7a0fm%2F5GBjZt5wMebHCQ23V5rbg9MkLRtSRRYsLY%3D) 1. Select **Custom** in the **Then** field and enter **Platinum Customer.** This is the Case Action which writes the value **Platinum customer** in output column **Customer Type**. ![M8.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M8(1).gif?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=G0BPrm18ObIGMjVMjx%2FVC3RnYabxaJV9JRQDGK7cix8%3D) 1. Click **+ Case** 2. Select: 1. **MRR** field 2. **>=** operator 3. **Value** 4. **3000** 3. Click **+ Criteria**. 4. Select: 1. **MRR** field 2. **<** operator 3. **Value** 4. **3999** This criteria is for Gold Customers. The value MRR must be between 3000 and 3999. ![M9.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M9(1).gif?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=%2FkB%2BYB%2BW6ceIAgevj7lhS9hkoidAtGGHJMxoWXhf4Z8%3D) 1. Select **Custom** in the **Then** field and enter **Gold customer.** ![M10.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M10(1).gif?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=M9gFV%2Fmt5rlMmM9NENivxkGYaxe0C4%2FT3uz6m1qGy%2FU%3D) 2. Similarly, create another two cases for Silver and Bronze customers with MRR between 2000-2999 and MRR less than 1999, respectively. ![M11.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M11(1).png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=ifhYu0HOeZQKDhyBnJubJeo2Zg8hPMh2aCd6ErsCoY4%3D) 3. Select **Custom** and type **Invalid Customer** in the **DEFAULT** field. 4. Click **SAVE**. ![M12.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M12(1).gif?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=c7CXLTCQR5D5Gp4t0H5ePgRXJ4CjmuH2inhpnWDO73c%3D) When you execute this rule, the following output is generated. ![M13.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/M13(1).png?sv=2026-02-06&spr=https&st=2026-11-30T20%3A42%3A33Z&se=2026-11-30T21%3A42%3A33Z&sr=b&sp=r&sig=bVwl0VNimZXAxJ5gVlc7UMtGeE8XleNRG493hOhDujU%3D)