Error using Multiple Filters on Beast Mode

Dear friends,


I trying to create a Multiple filter on Beast Mode following the instruction given on the link below.


https://knowledge.domo.com/Visualize/Adding_Cards_to_Domo/KPI_Cards/Transforming_Data_Using_Beast_Mode/Sample_Beast_Mode_Calculations%3A_Miscellaneous_Transforms


When a execute a test Domo returnos error information and didn´t apply any filter on the opened page.


Follow attached the code created to do this action and attached the error message returned on Domo.

Regards Junior

Answers

  • Jessica
    Jessica Contributor

    from my notes it looks like you are missing a few things


    From this line you are missing the ' at the end of the page number

    concat('<a style . . . . . ..domo.com/page/466192782'

    From this line you are missing the , ' before pfilters

    ,'pfilters=[{ . . .

  • Hi @Genival_Junior

    You're not closing your first pfilter correctly. You're leaving off the closing value code %22]}


    Also instead of passing in pfilter twice you can instead try and pass multiple values ni your pfilters list

    ?pfilter=[
    { filter1 information },
    { filter2 information}
    ]
    
    

    So in your example I'd remove the second ?pfilters={ and replace it with %22]},

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Hi Grant,

    Thanks for your answer this solve my problem, but i identified another one. It´s possible to identify the value selected on the filter page and use this value as parameter on Beast Mode ?

    Regards Junior

  • Hi @Genival_Junior

    Sadly no, cards / beast modes don't support parameters at this time.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Hi @GrantSmith ,

    There´s another way to open a page with the filters applied in Domo ?

    Regards Junior

  • I think I misunderstood your request. I thought you were asking about having the card allow you to change some value and it would update which it can't do. If you're wanting to just open a new link that's something that is possible. I've done a write up on it here using the HTML anchor (A) tag: https://dojo.domo.com/discussion/52683/domo-ideas-conference-beast-modes-images-and-hyperlinks. This is assuming you're using a field value as part of the your hyperlink.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Let me try to explain my scenario, I have trhee dashboards using the same dataset and treating similar informations but with diferent levels.

    There´s a main dashboard for the user start the analises ande if was necessary, using a link move to another dashboard.

    When I open the new page, i want to keep the filter from the main page, considering there are three diferent filters on the main page and the usar could selected any of of them.

    Because this scentario i was trying to use Multiple Filter on Beast Mode, but it´s provess not effective to get the selected value.

    So at this point , i am trying to identify if there´s another way to open a new page with filters applied , considering the value selected.

    Follow attached a example from my dashboards pages.


  • Ritwik
    Ritwik Contributor
    edited May 2021

    Hi @Genival_Junior


    I think I can help.


    I had a similar use case/issue when trying to pass through filters from one dashboard to the other.


    Using a beast mode, you can only pass ONE filter to a linked page. However, as you mentioned, on the main dashboard, people may have selected multiple filters before they get to the link to the secondary dashboard.


    What to do at a high-level:

    Create concatenated beast mode and reference it in your page filter link beast mode.


    My Example:

    On Main Page:

    First Filter: Our Property Name ("name")

    Second Filter: Competitor Property Name ("comp for")


    First, I create a beast mode called "Name and Comp For" on all my datasets:

    CONCAT(`Name`, ' ', `Comp For`)


    Now, when someone selects both filters, it will filter this Beast Mode to one true value (Property X and Comp Y filters turns into 'Property X Comp Y' value).


    Second, I create the beast mode that links to the subpage and passes this combined filter:


    CONCAT('<a href=''https://woodpartners.domo.com/page/2101023617?pfilters=['

    ,'{"column":"Name and Comp For","dataType":"string","operand":"IN","values":["'

    ,CONCAT(`Name`, ' ', `Comp For`)

    ,'"]}'

    ,']'' target="_blank" title="Open in Domo">',`Name`,'</a>'    

       )

     

    So, you are passing only one filter, but it is the combination of two fields. I think this may not work for all scenarios, but as long as the data is structured such that the combination of two, three, or however many fields make sense, this should work.


    Let me know if this makes sense.

  • Ritwik
    Ritwik Contributor
    edited May 2021

    @Genival_Junior


    So, specific to your example, I would create a new column using Beast Mode that is the combination of "Produtos" and "Projeto_Ajustado":


    1. CONCAT(`Produto`, ' ', `Projeto_Ajustado`) -- name it "Produto and Projeto_Ajustado"

    And then rework your main page filtering beast mode to something like (you only have a screenshot so can't copy and paste it here, will just shorten it, I think this should work as is though just without some of the extra formatting you have at the beginning):


    CONCAT('<a href=''https://claro-com-br.domo.com/page/466192782?pfilters=['

    ,'{"column":"Produto and Projeto_Ajustado","dataType":"string","operand":"IN","values":["'

    ,CONCAT(`Produto`, ' ', `Projeto_Ajustado`)

    ,'"]}'

    ,']'' target="_blank" title="Open in Domo">',`Dashboard de Lead Time`,'</a>'    

       )

  • That´s a great idea Ritwik,

    I will try to applied this solution and return with the status after that.

    Regards Junior

  • Hi @Ritwik ,

    I applied your solution, but this attend the scenario for my firts problem, it´s an easy way to use multiple links, in this case already helps a lot.

    But my main problem is how to get the selected value on filters dashboards.

    If you check my message om may 3th, there´s i explain the full context off my problem.

    Thank´s for your help.

    Regards Junior

  • @Genival_Junior , you can't. You would need a custom app for that.

    In order to do what you've describe, your beast mode for the p_filter would have to be able to perform a LIST_AGG() to collapse all the available values spread across rows into one row.


    I recommend finding a different solution to address your use case.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • Hi @jaeW_at_Onyx ,


    With all the informations that i had here, i started to stud a diferent scenario to solve my problem using a custom app. 


    For this moment i will use the link with a single filter in highier level off information.


    Thank´s for the tips to use LISTAGG, for this scenario it not will bu usefull, but it´s good know about this diferent SQL instruction.


    Regards Genivla Junior