Filter on two or more columns

Options

Do pfilters require special configuring of python or something?

I want to embed an anchor reference link, to open a drill through page filtered on two or more columns in the row that was clicked. In the example below, clicking the link on the first row would open a page filtered on store=5, salesperson=Ralph.

Store SalesPerson Amount Link
5 Ralph $500 {link}
3 Mary $800 {link}
2 John $300 {link}
5 Peter $400 {link}

The link page has summaries. The drill through will go to the details that were aggregated to make the summaries.

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

Best Answer

  • ColemenWilson
    edited August 2023 Answer ✓
    Options

    Python configuration not needed. We build ours in Magic ETL utilizing the Formula Tile.

    Steps:

    1. If you would like to create the URL for a page:
      1. Copy the pageID from the page's URL
      2. Paste it into the link below to replace pageID
        1. https://yourcompany.domo.com/page/pageID?pfilters=
      3. Copy the following text: [{"column":"columnToFilterOn","dataType":"string","operand":"IN","values":["valueFromColumnToFilterTo"]}]
        1. Replace columnToFilterOn with the EXACT column name from the datasource.
        2. Replace valueFromColumnToFilterTo with the EXACT value to use for filtering
      4. Go to this link: https://meyerweb.com/eric/tools/dencoder
      5. Paste the value from step 3 into the text box
      6. Click the "Encode" button
      7. Copy the encoded section of the URL, it should look something like this:
        1. %5B%7B%22column%22%3A%22DSO%20Account%20Name%22%2C%22dataType%22%3A%22string%22%2C%22operand%22%3A%22IN%22%2C%22values%22%3A%5B%22Practice%20Dental%22%5D%7D%5D%20
      8. Combine the first part of the URL from step 2 and the encoded section of the URL.
      9. The final result should look something like this: 
        1. https://yourcompany.domo.com/page/338030843?pfilters=%5B%7B%22column%22%3A%22DSO%20Account%20Name%22%2C%22dataType%22%3A%22string%22%2C%22operand%22

    In ETL you can make these dynamically for a page. Use the replace text tile or formula tile to create the unique parts of the URL. Then in a formula tile use a CONCAT function to bring the needed pieces together.

    More here: https://domo-support.domo.com/s/article/360042933114?language=en_US Example #1 shows what the syntax would be for multiple columns.

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

Answers

  • ColemenWilson
    edited August 2023 Answer ✓
    Options

    Python configuration not needed. We build ours in Magic ETL utilizing the Formula Tile.

    Steps:

    1. If you would like to create the URL for a page:
      1. Copy the pageID from the page's URL
      2. Paste it into the link below to replace pageID
        1. https://yourcompany.domo.com/page/pageID?pfilters=
      3. Copy the following text: [{"column":"columnToFilterOn","dataType":"string","operand":"IN","values":["valueFromColumnToFilterTo"]}]
        1. Replace columnToFilterOn with the EXACT column name from the datasource.
        2. Replace valueFromColumnToFilterTo with the EXACT value to use for filtering
      4. Go to this link: https://meyerweb.com/eric/tools/dencoder
      5. Paste the value from step 3 into the text box
      6. Click the "Encode" button
      7. Copy the encoded section of the URL, it should look something like this:
        1. %5B%7B%22column%22%3A%22DSO%20Account%20Name%22%2C%22dataType%22%3A%22string%22%2C%22operand%22%3A%22IN%22%2C%22values%22%3A%5B%22Practice%20Dental%22%5D%7D%5D%20
      8. Combine the first part of the URL from step 2 and the encoded section of the URL.
      9. The final result should look something like this: 
        1. https://yourcompany.domo.com/page/338030843?pfilters=%5B%7B%22column%22%3A%22DSO%20Account%20Name%22%2C%22dataType%22%3A%22string%22%2C%22operand%22

    In ETL you can make these dynamically for a page. Use the replace text tile or formula tile to create the unique parts of the URL. Then in a formula tile use a CONCAT function to bring the needed pieces together.

    More here: https://domo-support.domo.com/s/article/360042933114?language=en_US Example #1 shows what the syntax would be for multiple columns.

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

  • ArborRose
    Options

    I've done the this process, but I did not encode any part of it. The link moves to the desired page but all the filtering is dropped. Thus the question about whether anything else is need. There may be something wrong in my format. I've reviewed half dozen examples but can't get filtering.

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

  • ArborRose
    Options

    Thanks. I was lacking the encode step. If this helps anyone, this statement concatenates three filters as a link.

    CONCAT('

    <a href="https://domain.domo.com/page/*******?pfilters='
    ,'%5B%7B%22column%22%3A%22field1_id%22%2C%22dataType%22%3A%22string%22%2C%22operand%22%3A%22IN%22%2C%22values%22%3A%5B%22',`field1_id`,'%22%5D%7D%2C'
    ,'%7B%22column%22%3A%22field2_id%22%2C%22dataType%22%3A%22string%22%2C%22operand%22%3A%22IN%22%2C%22values%22%3A%5B%22',`field2_id`,'%22%5D%7D%2C'
    ,'%7B%22column%22%3A%22field3_id%22%2C%22dataType%22%3A%22string%22%2C%22operand%22%3A%22IN%22%2C%22values%22%3A%5B%22',`field3_id`,'%22%5D%7D%5D'
    ,'" target="_blank" title="Open in Domo"></a>

    ','Note Text Link','')

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

  • Ashleigh
    Ashleigh Coach
    edited August 2023
    Options

    @colemenwilson thank you for these detailed instructions! I was just trying to do this the other day and it was giving me issues. I was missing the encoding part, I followed your steps and now it works!

    **If this answer solved your problem be sure to like it and accept it as a solution!

  • ArborRose
    Options

    My pfilters are working but the link does not maintain the date range. If I allow users to set date between…how can I include that as a pfilter so the detail page limits to the same range?

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