Forum Discussion
kh3ldar
Feb 10, 2023Copper Contributor
Filter and Sortby Nested
Hello,
I'm trying to sort an array based on a helper column inside a table.
=FILTER(SORTBY(countTBL[Name],countTBL[Type],1),(SORTBY(countTBL[Type],countTBL[Type],1)=1)*(countTBL[Shift]="Morning"))
This is my messed up formula.
I need to filter names by countTBL[Shift] and then sort countTBL[Name] by countTBL[Type] in ascending order but I haven't been successful.
I'd greatly appreciate your assistance.
- Riny_van_EekelenPlatinum Contributor
kh3ldar Can't be sure without seeing the underlying data, but I think the formula below does what you have in mind.
=SORT(FILTER(countTBL[Name],(countTBL[Type]=1)*(countTBL[Shift]="Morning")))
It filters the Name column where Type = 1 and Shift = "Morning". Then it sorts the array in ascending order.