Using Sortby with Filter and index

%3CLINGO-SUB%20id%3D%22lingo-sub-2750143%22%20slang%3D%22en-US%22%3EUsing%20Sortby%20with%20Filter%20and%20index%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2750143%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20i%20am%20trying%20to%20add%20a%20sortby%20in%20this%20formula%2C%20anybody%20knows%20if%20its%20possible.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DFILTER(INDEX(Vulnerabilities%2CSEQUENCE(ROWS(Vulnerabilities))%2C%7B2%2C4%2C8%2C3%2C5%2C6%2C7%2C10%7D)%2C(Vulnerabilities%5BApplication%20group%5D%3DLookup!C3)*(Vulnerabilities%5BStatus%5D%3D%22New%22)%2C%22No%20New%20Vulnerability%20Found%22)%3CBR%20%2F%3E%3CBR%20%2F%3Ei%20added%20a%20the%20sortby%20after%20the%20filter%20however%20as%20soon%20as%20i%20do%20it%20does%20not%20return%20the%20right%20values%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2750143%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2750401%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Sortby%20with%20Filter%20and%20index%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2750401%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1155806%22%20target%3D%22_blank%22%3E%40Frenchy_c%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20looks%20like%20you%20filter%20sorted%20table%20using%20criteria%20applied%20to%20unsorted%20table%20-%20result%20is%20unpredictable%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello, i am trying to add a sortby in this formula, anybody knows if its possible.

 

=FILTER(INDEX(Vulnerabilities,SEQUENCE(ROWS(Vulnerabilities)),{2,4,8,3,5,6,7,10}),(Vulnerabilities[Application group]=Lookup!C3)*(Vulnerabilities[Status]="New"),"No New Vulnerability Found")

i added a the sortby after the filter however as soon as i do it does not return the right values

 



2 Replies

@Frenchy_c 

It looks like you filter sorted table using criteria applied to unsorted table - result is unpredictable

@Sergei Baklan Thanks, I am not sure I understand, but my goal is to get a sorted dynamic array

My original table "Vulnerabilities" isn't sorted


=FILTER(INDEX(Vulnerabilities,SEQUENCE(ROWS(Vulnerabilities)),{2,4,8,3,5,6,7,11}),(Vulnerabilities[Application group]=Lookup!C3)*(Vulnerabilities[Status]<>"New")*(Vulnerabilities[Status]<>"Resolved"),"No Vulnerability Found")


This formula gets me the data I want, but its not sorted in a way I like. so i am wondering if there is a way to sort the result of the formula