Skip to main content
Version: I2023.3.0

Example Expressions

Here you can find examples of report-scoped measure expressions that are supported by AtScale. The examples are based on the sample project available at the AtScale downloads site.

Measures and Dimensions used in the examples

Measures: :

[Internet Sales Amount Local] - Sum of Sales (Float)
[Internet Order Count] - Sum of Sales (Integer)
[Order Quantity Long] - Sum of Sales (Long)

Dimensions: :

[Product].[Color] - secondary  attribute
[DateCustom].[Reporting Day] - secondary attribute
[Product].[Product Categories] - hierarchy

Examples

  • Average of [Internet Order Count] and [Order Quantity Long]: :

    ([Internet Order Count] + [Order Quantity Long]) / 2
  • Select the [Product Category] Sales Percent of Total Sales:

    Note that the ALL() function references the hierarchy name instead of a Table name. :

    [Internet Sales Amount Local] / CALCULATE([Internet Sales Amount Local], ALL('Product Categories'))
  • Select sum of sales where Product = Red:

    Note only static members can be referenced, such as "Red". The equality constraint cannot be compared to a function. :

    CALCULATE([Internet Sales Amount Local],'Product'[Color] = "Red")
  • Select Total Sales by Product Category

    Note that the ALL() function references the hierarchy name instead of a Table name. :

    CALCULATE([Internet Sales Amount Local], ALL('Product Categories'))
  • Average Sales Amount per Order: :

    DIVIDE([Reseller Sales Amount Local], [Reseller Order Count])