cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Filtering Distinct results

So I have been researching and can't really find this info. 

I am currently utilizing the Distinct filtering a Sharepoint list. It is working to pull in each individual "item" once. BUT there are a few results i would like to eliminate and not have them as an option. 

See, i am using this combobox to filter a gallery based on their choices. but the items i would like removed from the combobox should not be seen if they are categorized that way. 

Here is what i have so far: 

Sort(
    Filter(
        Ungroup(
            Table(
                {DeptTable: Blank()},
                {
                    DeptTable: Distinct(
                        DIDExtTable,
                        UserDept
                    )
                }
            ),
            "DeptTable"
        ),
        ComboBox2.SearchText in Result
    ),
    Reset,
    Ascending
)

This will display my results and actually ADD a blank field But i would like to remove something from it. 

 

Any help would be appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @AsaurdiffADTill 

 

  1. We can filter the data before getting distinct. In this example, I'm removing "BA" from the list.
Sort(
    Filter(
        Ungroup(
            Table(
                {DeptTable: Blank()},
                {
                    DeptTable: Distinct(
                        With(
                            {_Item: 'External User'},
                            Filter(
                                _Item,
                                Designation <> "BA"
                            )
                        ),
                        Designation
                    )
                }
            ),
            "DeptTable"
        ),
        ComboBox2.SearchText in Result
    ),
    Result,
    Ascending
)

 

Another option is to use collection and remove items from the collection. Assign collection to Combo box

 

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @AsaurdiffADTill 

 

I'm not really getting what exactly you are trying to do but I believe you are doing sorting on the Result

Sort(
    Filter(
        Ungroup(
            Table(
                {DeptTable: Blank()},
                {
                    DeptTable: Distinct(
                        DIDExtTable,
                        UserDept
                    )
                }
            ),
            "DeptTable"
        ),
        ComboBox2.SearchText in Result
    ),
    Result,
    Ascending
)

 

  • Let me know the Items property of ComboBox2
  • Are you trying to filter gallery or another combobox?

 

The items property is what you are looking at. I am taking the results of the distinct filter and adding another field to it by creating a table instead of the distinct results. This allows me to utilize a "blank()" for reference. I would like to remove some of the results found in the Distinct filter. 

StalinPonnusamy
Super User
Super User

Hi @AsaurdiffADTill 

 

  1. We can filter the data before getting distinct. In this example, I'm removing "BA" from the list.
Sort(
    Filter(
        Ungroup(
            Table(
                {DeptTable: Blank()},
                {
                    DeptTable: Distinct(
                        With(
                            {_Item: 'External User'},
                            Filter(
                                _Item,
                                Designation <> "BA"
                            )
                        ),
                        Designation
                    )
                }
            ),
            "DeptTable"
        ),
        ComboBox2.SearchText in Result
    ),
    Result,
    Ascending
)

 

Another option is to use collection and remove items from the collection. Assign collection to Combo box

 

HI @StalinPonnusamy ,

This worked Great! So basically you mess with the "data source" of the Distinct function and then "re-Ask" for the new data. I LOVE IT!

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,294)