Is there a way to create a filter for line charts

Is there a way to have a multi-line chart connected to a filter which can allow a user to select which metrics they want to see on the chart?

Answers

  • @NathanDorsch A couple of ways you could do this. You can either start off the chart with all the lines and then the user can deselect what they don't want to see by clicking on the metric in the legend. A second option would be to use variables. You could create x number of variables for the number of lines you would want displayed, and each variable would have the metric options. Then each line would have a beastmode to show the metric that would correspond to one of the variables.

    **Was this post helpful? Click Agree or Like below**

    **Did this solve your problem? Accept it as a solution!**

  • NathanDorsch
    NathanDorsch Member
    edited March 2023

    Thanks Rob. I'm intrigued by your latter option... Can you elaborate further how I'd do this? Below is basically how my dataset looks:

    Date - Channel - Impressions - Clicks - Sales - Spend

    I then create beastmodes to calculate values such as CPC (spend/clicks), ROAS (Sales/Spend), CTR (Clicks/Impressions). These are the lines I want to have on the line chart and allow a user to select which combination of them to be displayed...

  • @NathanDorsch So you would create a number of variables equal to the maximum number of lines you would want displayed (we'll use 3 for the examples you gave). You could name them Line 1, Line 2, and Line 3. Each one would have CPC, ROAS, and CTR as values. Then you would create 3 beast modes like the following:

    case when 'Line 1' = 'CPC' then [CPC calculation]

    when 'Line 1' = 'ROAS' then [ROAS calculation]

    when 'Line 1' = 'CTR' then [CTR calculation]

    end

    Then use additional beast modes for more lines. You could also add a 'Blank' value for each variable and then in the beastmodes when the value = 'Blank' then you could set it to 0 so the line can be out of the way.

    **Was this post helpful? Click Agree or Like below**

    **Did this solve your problem? Accept it as a solution!**

  • I still don't understand... I am attempting to create a variable as you stated... what am I doing wrong here?


  • @NathanDorsch Next step is to click on 'Create Control' and define what values the variable can have. You've only set up what the default value will be, but you need to set up the actual values. Here's Domo's knowledge base article about variables:

    https://domo-support.domo.com/s/article/7903767835031?language=en_US

    **Was this post helpful? Click Agree or Like below**

    **Did this solve your problem? Accept it as a solution!**

  • I've created variables Lines 1 and 2 as you instructed. I created the beastmodes as you instructed. I placed the beastmodes in the values (Y axis and series values)... and I get an issue. What I am I doing wrong here?


  • @NathanDorsch Could you post the configuration for one of your variables and your beast mode? It looks like there's something going on with one of those things.

    **Was this post helpful? Click Agree or Like below**

    **Did this solve your problem? Accept it as a solution!**

  • So... Domo wouldn't let me save the card. And now I lost all the updates. Before I spend anymore time on this, do you have a screenshot of what this might look like?