I have a gallery of a SharePoint list and I'm trying to enable the options to filter it by Location and/or Reason Code and/or Status. Then I want to enable the ability to sort whatever the results may be from the filter by date. Here is what I've done and it works, but it just seems tedious and cumbersome:
SortByColumns(
If(
//All Same
gallery_Status.Selected.Value = "All" && drop_SiteFilter.Selected.Value = "All" && drop_ReasonFilter.Selected.Value = "All",
'High Level Inventory Discard'
,
//Different Status
gallery_Status.Selected.Value <> "All" && drop_SiteFilter.Selected.Value = "All" && drop_ReasonFilter.Selected.Value = "All",
Filter(
'High Level Inventory Discard',
'Discard Status' = gallery_Status.Selected.Value
),
//Different Site
gallery_Status.Selected.Value = "All" && drop_SiteFilter.Selected.Value <> "All" && drop_ReasonFilter.Selected.Value = "All",
Filter(
'High Level Inventory Discard',
Location.Value = drop_SiteFilter.Selected.Value
),
//Different Reason
gallery_Status.Selected.Value = "All" && drop_SiteFilter.Selected.Value = "All" && drop_ReasonFilter.Selected.Value <> "All",
Filter(
'High Level Inventory Discard',
'Reason Code'.Value = drop_ReasonFilter.Selected.Value
),
//Different Status and Site
gallery_Status.Selected.Value <> "All" && drop_SiteFilter.Selected.Value <> "All" && drop_ReasonFilter.Selected.Value = "All",
Filter(
'High Level Inventory Discard',
'Discard Status' = gallery_Status.Selected.Value && Location.Value = drop_SiteFilter.Selected.Value
),
//Different Status and Reason
gallery_Status.Selected.Value <> "All" && drop_SiteFilter.Selected.Value = "All" && drop_ReasonFilter.Selected.Value <> "All",
Filter(
'High Level Inventory Discard',
'Discard Status' = gallery_Status.Selected.Value && 'Reason Code'.Value = drop_ReasonFilter.Selected.Value
),
//Different Site and Reason
gallery_Status.Selected.Value = "All" && drop_SiteFilter.Selected.Value <> "All" && drop_ReasonFilter.Selected.Value <> "All",
Filter(
'High Level Inventory Discard',
Location.Value = drop_SiteFilter.Selected.Value && 'Reason Code'.Value = drop_ReasonFilter.Selected.Value
),
//Different All
gallery_Status.Selected.Value <> "All" && drop_SiteFilter.Selected.Value <> "All" && drop_ReasonFilter.Selected.Value <> "All",
Filter(
'High Level Inventory Discard',
'Discard Status' = gallery_Status.Selected.Value && Location.Value = drop_SiteFilter.Selected.Value && 'Reason Code'.Value = drop_ReasonFilter.Selected.Value
)
),
"Date",
If(
varDateSort = false,
Ascending,
Descending
)
)
Solved! Go to Solution.
Sure, here you go, same formula but a little easier to work with:
SortByColumns(
Filter('High Level Inventory Discard'
(gallery_Status.Selected.Value = "All" || 'Discard Status' = gallery_Status.Selected.Value) &&
(drop_SiteFilter.Selected.Value = "All" || Location.Value = drop_SiteFilter.Selected.Value) &&
(drop_ReasonFilter.Selected.Value = "All" || 'Reason Code'.Value = drop_ReasonFilter.Selected.Value)
),
"Date",
If(varDateSort = false, Ascending, Descending)
)
I hope this is helpful for you.
Sure, here you go, same formula but a little easier to work with:
SortByColumns(
Filter('High Level Inventory Discard'
(gallery_Status.Selected.Value = "All" || 'Discard Status' = gallery_Status.Selected.Value) &&
(drop_SiteFilter.Selected.Value = "All" || Location.Value = drop_SiteFilter.Selected.Value) &&
(drop_ReasonFilter.Selected.Value = "All" || 'Reason Code'.Value = drop_ReasonFilter.Selected.Value)
),
"Date",
If(varDateSort = false, Ascending, Descending)
)
I hope this is helpful for you.
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
217 | |
180 | |
138 | |
96 | |
73 |