Apply a % Model based on an identifying field

Hi All

I've got a challenge when trying to apply a sum(max()) value to my card as there is a variable I can't identify correctly

In my data (anonymized) I have the following columns I need to use for this:

[Customer], [Model Type], [Model %], [Master Description], [Sub Description]

What I need to do is, when a [Customer] is selected then look at the [Model Type] (Standard or Priority) and apply the SUM(MAX()) [Model %] but when no [Customer] is selected then apply the SUM(MAX()) [Model %] of Standard [Model Type] to all of my data

In my Card (Table) What I would expect to see is when a customer is selected from the Filter the calculation would show the correct % of the summed [Model %] for said customer but if no customer is selected, then it would show the Standard [Model %] as a default

TLDR: When a Customer is selected, apply the MAX aggregation of the [Model %] based on [Model Type] else use [Model Type] = Standard

Apologies if this is badly worded as I'm struggling to find the right way to ask the question on Google to get toward the answer I need but I can elaborate if needed

Thanks for any and all support/responses
Dan

Tagged:

Best Answer

  • Manasi_Panov
    Manasi_Panov Contributor
    Answer ✓

    Hi @_DanielB_,

    I would define a variable with two options: "Selected Customer" and "All Customers." When "Selected Customer" is chosen, the filter card will enable customer-specific filtering. If "All Customers" is selected, filter options will be removed. Calculations and filters will be adjusted accordingly based on the selected option.

    Here is an example dataset:

    The variable:

    The table:

    Calculation:
    CASE
    WHEN DOMO Forum Answers Var = 'Selected Customer' THEN SUM(Model %)
    WHEN DOMO Forum Answers Var = 'All Customers' THEN CASE WHEN Model Type = 'Standard' THEN SUM(Model %) END
    END

    Filter:
    CASE
    WHEN DOMO Forum Answers Var = 'Selected Customer' THEN 'TRUE'
    WHEN DOMO Forum Answers Var = 'All Customers' THEN CASE WHEN Model Type = 'Standard' THEN 'TRUE' END
    END

    The result will be displayed on the dashboard. When "Selected Customer" is selected, the filter will show all customers, allowing the user to choose one.

    And the result is calculated for each Model Type:

    When "All Customers" is selected, the customer filter remains empty, and the results are calculated only for Standard Model Types.

    I hope this meets your requirements. If you need any modifications or have any questions, feel free to ask. I'm happy to assist further.

    If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.

Answers

  • Manasi_Panov
    Manasi_Panov Contributor
    Answer ✓

    Hi @_DanielB_,

    I would define a variable with two options: "Selected Customer" and "All Customers." When "Selected Customer" is chosen, the filter card will enable customer-specific filtering. If "All Customers" is selected, filter options will be removed. Calculations and filters will be adjusted accordingly based on the selected option.

    Here is an example dataset:

    The variable:

    The table:

    Calculation:
    CASE
    WHEN DOMO Forum Answers Var = 'Selected Customer' THEN SUM(Model %)
    WHEN DOMO Forum Answers Var = 'All Customers' THEN CASE WHEN Model Type = 'Standard' THEN SUM(Model %) END
    END

    Filter:
    CASE
    WHEN DOMO Forum Answers Var = 'Selected Customer' THEN 'TRUE'
    WHEN DOMO Forum Answers Var = 'All Customers' THEN CASE WHEN Model Type = 'Standard' THEN 'TRUE' END
    END

    The result will be displayed on the dashboard. When "Selected Customer" is selected, the filter will show all customers, allowing the user to choose one.

    And the result is calculated for each Model Type:

    When "All Customers" is selected, the customer filter remains empty, and the results are calculated only for Standard Model Types.

    I hope this meets your requirements. If you need any modifications or have any questions, feel free to ask. I'm happy to assist further.

    If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.

  • This might be the most in depth and detailed response I've ever received to a challenge before! Thank you so much.. When I am back on this project, I will be implementing this solution!