0

Filtering Products in the table by Dynamic Choice

Happy new year and wish foe all happiness and peaceful skies
I can't set up any filtering of products in the Mine_Page. Following the advice and tips, we tried to filter not directly from the Selection Field and through formulas that display the selection field. We were unable to obtain the result.
 

5 replies

null
    • Fred
    • 12 days ago
    • Reported - view

    As I played around with your previous database I ran into the following question:

    Do you want to find products that have at least 1 of the selected characteristics? Which is not very helpful.

    Which got me thinking if some categories have a higher significance than others? I think that a hierarchy would start with Seasons, then Color, then Size. So if I select Summer, I only want to see color and sizes that fit. If I only select a color then I want to see all that fit the color regardless of season or size, but the moment I select a Season then that starts to limit things

    I've attached a simple search that looks for any products that have at least 1 or the selected categories on Main_Page. You will see that as you select more categories the view grows because more products match at least 1 of the categories.

    You will see that I have stop using Filter as already have the categories you need.

      • iliper LTD
      • iliper_LTD
      • 12 days ago
      • Reported - view

       Thank You,

      I understood your question and decided to create a hierarchy, but in order not to be tied to the name, I added a digital field and the number designates the priority, digit 1-2 of the filter number is the priority of the value "and" and the rest have the value "OR"
       

      let s := selectedTerms;
      let priorityFilters := (select Filter_Name where Priority <= 2);
      let secondaryFilters := (select Filter_Name where Priority > 2);
      
      (select Products)[
          var y := SearchTerms;
          // Check that all priority filters match with selectedTerms
          count(priorityFilters[var p := this; count(s[? this = p]) > 0]) = count(priorityFilters)
          // Check that at least one secondary filter matches with selectedTerms
          and count(secondaryFilters[var f := this; count(s[? this = f]) > 0]) > 0
      ]
      
      

      This formula checks:

      1. Strict matching for priority filters: Ensures all priority filters must match the selected terms.
      2. Flexible matching for secondary filters: Ensures that at least one secondary filter matches the selected terms.
        I can't understand what the mistake is
    • Fred
    • 11 days ago
    • Reported - view

    I took a different path. See the attached DB. The big thing is adding a dMC for each of the categories in both the Main_Page and the Products table. I removed the Filter field from the Products table as I felt it was needed. As each product seemed to have a choice in all the categories.

      • iliper LTD
      • iliper_LTD
      • 11 days ago
      • Reported - view

      your approach is a little bit wrong, because if you add another filter, you will have to manually add a new category, and the previous approach solved this problem without further intervention

      But now the task is how to filter if i add a new field for priorities? I tried many approaches but I can't solve the problem

    • Fred
    • 11 days ago
    • Reported - view
     said:
    But now the task is how to filter if i add a new field for priorities? I tried many approaches but I can't solve the problem

    One way is to separate the priorities from the other searches. Take a look at how I did it in v2.