Forum Discussion
rttmmwv
Feb 05, 2022Copper Contributor
Help With Filter Function
Hello All,
I hope nothing too similar has been posted before, but I am struggling with a filter function.
I have two sheets, One where data will be displayed to the end user, and a query that contains the information to be fetched. I am trying to have a section auto-complete with Employee Names, where employee cost center is XXXXX and Employee Job Title is EITHER Production Team Member OR Production Temporary. The filter is mostly working, but I am getting results for all job titles in the cost center (so, it is also pulling supervisors). I am using the below formula to accomplish this.
=FILTER(INDEX(HCData!A:G,SEQUENCE(ROWS(HCData!A:G)),{4,7}),(HCData!A:A=$A$13)*OR(ISNUMBER(SEARCH("Production Temporary",HCData!C:C)),ISNUMBER(SEARCH("Production Team Member",HCData!C:C))),)
I originally tried using boolean argument for the OR condition, but that didn't work so I tried an OR function.
Unfortunately, I'm not able to provide the spreadsheet due to the nature of the data. My query columns are: "Cost Center" "ID Number" "Job Title" "Name" "Shift" "Job Code" and "Job Code Abbreviated (conditional column)".
Please let me know if any additional information would be helpful. I do have another cell using formula: =FILTER(INDEX(HCData!$A:$G,SEQUENCE(ROWS(HCData!$A:$G)),{4,7}),(HCData!$C:$C="Production Team Leader")*(HCData!$A:$A='DAT1 Org Chart (1st)'!$A$13),)
This formula is only returning the correct job title, so I know that the issue lies somewhere in adding a 3rd condition.
=FILTER(INDEX(HCData!A1:G50;SEQUENZ(ZEILEN(HCData!A1:G50));{4.7});(HCData!A1:A50=A13)*((HCData!C1:C50="Production Team Member")+(HCData!C1:C50="Production Temporary"));)
This formula works in my spreadsheet.
- harshulzIron Contributoryou trying to say you have two excel sheets
one the filtered one you have to present to end user with the following queries? ryt? - OliverScheurichGold Contributor
=FILTER(INDEX(HCData!A1:G50;SEQUENZ(ZEILEN(HCData!A1:G50));{4.7});(HCData!A1:A50=A13)*((HCData!C1:C50="Production Team Member")+(HCData!C1:C50="Production Temporary"));)
This formula works in my spreadsheet.
- rttmmwvCopper ContributorSorry, I realized the error was coming from using semi-colon instead of comma. The Formula isn't giving errors now, but I'm getting "0" as the sole result.
- OliverScheurichGold Contributor
The formula returns the values from columns 4 and 7 of sheet "HCData". I deleted all the data in column 4 (Name) of sheet "HCData" and the formula returns only "0" for this column as you can see in the attached file. Maybe this is what happens in your file.
- rttmmwvCopper ContributorWould "SEQUENZ" be "SEQUENCE" and "ZEILEN" be "ROWS"? That is what I'm guessing based on google.... I don't have either of those exact functions.
I am also getting an error at "(INDEX(HCData!A1:G50;"