Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Bucketing Value with condition

Hello all, 

Im pretty new here, hope to get help from everyone to solve this case. 

Dummy table: 

Item ForecastTtl open order + ShipmentTtl Order - Forecast
A12017555
B22095-125
C600-60
D0100100

Outcome i would like to get:

Order vs forecast ForecastTtl open order + ShipmentTtl Order - Forecast
Order > forecast 12017555
Order < forecast 22095-125
Forecast without orders 600-60
Zero forecast 0100100
Total 400370-30

 

TIA 🙂 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous,

    You can add a calculated column to check these two field values and return tags. Then you can use these fields to create a table visual to achieve your requirement:

    Tag =
    VAR diff = Table[Forecast] - Table[Ttl open order + Shipment]
    RETURN
        SWITCH (
            Table[Forecast],
            diff, "Forecast without orders",
            0, "Zero forecast",
            IF (
                diff = 0,
                "Order = forecast",
                IF ( diff > 0, "Order > forecast", IF ( diff < 0, "Order < forecast" ) )
            )
        )

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    You can add a calculated column to check these two field values and return tags. Then you can use these fields to create a table visual to achieve your requirement:

    Tag =
    VAR diff = Table[Forecast] - Table[Ttl open order + Shipment]
    RETURN
        SWITCH (
            Table[Forecast],
            diff, "Forecast without orders",
            0, "Zero forecast",
            IF (
                diff = 0,
                "Order = forecast",
                IF ( diff > 0, "Order > forecast", IF ( diff < 0, "Order < forecast" ) )
            )
        )

    Regards,

    Xiaoxin Sheng