Using Weighted Data with Cards

When working with data and building cards, is there any way to utilize beast modes to apply a weighted value across multiple variables? There is a weight variable within the dataset, and we are trying to apply those varying weights and display the updated values on a dashboard. Does the SQL syntax have the capability of multiplying two variables together within beast modes? If not, does DOMO ETL have this function available? Or does it make more sense to weight our data using SAS or R and then upload those values to DOMO?

Best Answers

  • ColemenWilson
    Answer ✓

    Hi @mcruz24 , I think what you are asking is can you multiply two fields together to create a new field, example: Value * Weight = Weighted Value.

    You can do this in an ETL or in a beastmode.

    For the beastmode, it would look like this (swapping out your field names):

    `Value` * `Weight`
    

    Then, you can use that beastmode as a field in your visualization.

    If I solved your problem, please select "yes" above

  • nmizzell
    nmizzell Contributor
    Answer ✓

    To add on to @ColemenWilson 's suggestion, you can multiply a value by another value using a conditional statement. For example:

    Case

    when demographic = 'male' then score * 2

    when demographic = 'female' then score * 1.5

    else score * 1.0

    end

Answers

  • savannaho
    savannaho Domo Employee

    @mcruz24 do you have a screenshot of what it is you're looking for? I'm not sure I follow.

  • mcruz24
    mcruz24 Member

    No, to give more background, we have survey data that needs to be weighted, and we want to create cards illustrating the weighted data. Looking through the functionality of DOMO ETL and beast modes, we are curious if we can weigh the data within DOMO itself, using either an ETL or beast mode, and apply them to cards. For example, we have a variable X and want to apply the weight of Y; I know that in SAS, we have the functionality of applying Y to each level of X, changing the values of X.

  • JedP
    JedP Domo Employee

    Hello @mcruz24 ,

    Yes, you can use variables to create weighted options and its usually the go to option to ensure your data is dynamically calculating the values. I have a few demo pages that use variables you could review for some ideas and sample codes. Take a look and let me know if you have any questions.

    Variables - This page has a few examples of how to use variables in calculations. https://embed.domo.com/embed/pages/P1VX1

  • ColemenWilson
    Answer ✓

    Hi @mcruz24 , I think what you are asking is can you multiply two fields together to create a new field, example: Value * Weight = Weighted Value.

    You can do this in an ETL or in a beastmode.

    For the beastmode, it would look like this (swapping out your field names):

    `Value` * `Weight`
    

    Then, you can use that beastmode as a field in your visualization.

    If I solved your problem, please select "yes" above

  • nmizzell
    nmizzell Contributor
    Answer ✓

    To add on to @ColemenWilson 's suggestion, you can multiply a value by another value using a conditional statement. For example:

    Case

    when demographic = 'male' then score * 2

    when demographic = 'female' then score * 1.5

    else score * 1.0

    end