In this article, I will share some Compute expressions examples. As you know Compute expression is basically used to add additional fields, and these additional derived fields preparation formulas are very important for datasets building process.
Below are few very simple expressions to get started with compute expressions and understand different ways of building them.
Arithmetic operators: for creating Measure/Numeric fields
Example:


String operators: for creating Dimension/Text fields
Example 1:

Example 2:

Example 3:

Example 4:

Date functions: to create Date fields
Example 1:


Date Format examples: “yyyy-MM-dd”, “yyyy-MM-dd HH:mm:ss”
Case Statements
Example 1:

Example 2:

Example 3:

Example 4:

Example 5:

Example 6:

Example 7:

Example 8:

Nested Case Statements
Example 1:

Example 2:

Hope this collection of examples help you next time you are building Dataflow/Datasets.
Happy reading š
Thank you.
Gayatri Sharma

I have 8+ yrs of experience in Sales, Service, Community and Analytics cloud. I love converting business intuition with technical skills into intelligent business analytics. Iām honored to be an Einstein Analytics Champion.
Also writing @Medium: https://medium.com/@gayatrisharma88