admin管理员组

文章数量:1130191

I am required to put customers into separate buckets. so if the revenue trend for 2g devices and/or 3g devices revenue trend is increasing then put in option a etc. I have 4 different buckets and then an unclassified. This uses a SWITCH but I am finding that customers are being put into multiple buckets. For example customer A has the following revenue trends - 2g devices increasing, 3g devices decreasing, 4g devices increasing and 5g devices increasing. As one of the 2g or 3g is increasing it should be put in bucket A 2g/3g increasing, but it is also being put into 2g/3g decreasing, 4g/5g increasing. Therefore causing an overlap

Customer Bucket = 
SWITCH(
    TRUE(),
    -- Bucket 1: 2G/3G Increasing (Highest Priority)
    OR(
        [2G Revenue Trend] = "Increasing",
        [3G Revenue Trend] = "Increasing"
    ), "2G/3G Increasing",

    -- Bucket 2: 2G/3G Decreasing but 4G/5G Increasing
    AND(
        OR([2G Revenue Trend] = "Decreasing", [3G Revenue Trend] = "Decreasing"),
        OR([4G Revenue Trend] = "Increasing", [5G Revenue Trend] = "Increasing")
    ), "2G/3G Decreasing, 4G/5G Increasing",

    -- Bucket 3: 2G/3G and 4G/5G Decreasing
    AND(
        OR([2G Revenue Trend] = "Decreasing", [3G Revenue Trend] = "Decreasing"),
        OR([4G Revenue Trend] = "Decreasing", [5G Revenue Trend] = "Decreasing")
    ), "2G/3G and 4G/5G Decreasing",

    -- Bucket 4: 2G/3G Decreasing but 4G/5G Stagnant
    AND(
        OR([2G Revenue Trend] = "Decreasing", [3G Revenue Trend] = "Decreasing"),
        AND([4G Revenue Trend] = "Stagnant", [5G Revenue Trend] = "Stagnant")
    ), "2G/3G Decreasing, 4G/5G Stagnant",

    -- Default Case
    "Unclassified"
)

this is the code but it is allowing customers to be in multiple which I don't want

本文标签: