SETNUMBERFORMATTING

Use SETNUMBERFORMATTING to switch the number formatting applied to values in a planning sheet. The function supports four formatting modes: Native, Uniform, Measure Level, and Auto.

Syntax

The following example switches the planning sheet to uniform number formatting.

SETNUMBERFORMATTING(NUMBERFORMATTING.UNIFORM)

Parameters

Parameter Description
NUMBERFORMATTING.NATIVE Uses the native number formatting behavior.
NUMBERFORMATTING.UNIFORM Applies uniform number formatting to values in the planning sheet.
NUMBERFORMATTING.MEASURELEVEL Uses the number formatting configured for each measure.
NUMBERFORMATTING.AUTO Uses automatic number formatting.

The function accepts one formatting mode from the NUMBERFORMATTING reference. Select the mode that matches how you want values to appear in the planning sheet.

Example

Create a parameter that lets users switch between uniform number formatting and measure-level number formatting.

  1. Open the planning sheet.

  2. Open the Parameters pane and create a new parameter.

  3. Set Type to Action.

  4. Enter a name, such as Choose Number Format.

  5. Set Interface Type to Toggle.

  6. Enable Enable Script.

  7. Set Default State to Uniform.

  8. Add an action for each toggle state.

    For the On state, set the label to Uniform and enter the following formula in Formula Script:

    SETNUMBERFORMATTING(NUMBERFORMATTING.UNIFORM)
    

    Screenshot of the On State Configuration with Uniform selected and the SETNUMBERFORMATTING formula.

    For the Off state, set the label to Measure level and enter the following formula in Formula Script:

    SETNUMBERFORMATTING(NUMBERFORMATTING.MEASURELEVEL)
    

    Screenshot of the Off State Configuration with Measure level selected and the SETNUMBERFORMATTING formula.

  9. Select Include in read mode if users must be able to switch the formatting mode in read mode.

  10. Save the parameter and update the planning sheet.

    When the toggle is on, the planning sheet uses uniform number formatting. In the example, the values are displayed to one decimal place.

    Screenshot of the planning sheet with Uniform number formatting enabled and values displayed to one decimal place.

    When the toggle is off, the planning sheet uses the number formatting configured at the measure level. In the example, the values retain two decimal places and the measure headers include the unit label.

    Screenshot of the planning sheet with Measure level number formatting enabled and values displayed to two decimal places.