TableSorter filer functionality - tablesorter

I am wondering if I can have "!Peter" option while filering on the first column of the first table example here?
I should be able to have all other options + !Peter ?
Thanks in advance,
Aparna

The demo you linked would not allow you to enter and search for !Peter because:
The first column (with "Peter" in it) is set up to use a select element.
You could enter !Peter in the second column, but it would not return any results because that column is set up to only return exact matches.
I set up this demo without either of those restrictions, and if you enter !Peter into either of the first two columns, the expected results will show.
Now, if you mean you want to change the select element options, then you should look at the documentation for the filter_selectSource option.

Related

Filtering a Non-Unique Data Set in Google Sheets

I have a list of recipe, and I also have a list of sold menu. Is there any way that can filter the recipe (can be with query, or not) by looking at the menu (that can repeat more than once)?
https://docs.google.com/spreadsheets/d/1Ire32u7kELCAu07AHiTGt8yoXwCWDpvT77nQYSN21DU/edit#gid=0
This is the sample case
A2:B7 is the list of recipe
D2:D7 is the list of menu sold
F2:F13 is the desired result
Arrayformula is preferred since I don't have to drag down again when the data set get bigger.
try:
=FLATTEN(BYROW(D2:D7, LAMBDA(x, TRANSPOSE(FILTER(A2:A7, B2:B7=x)))))
In case you have unmatching amount of items per menu (I added two extra elements to tenderloin), you can try this other option so you don't have empty spaces:
=TRANSPOSE(SPLIT(JOIN(",",BYROW(D2:D,LAMBDA(r,IF(r="",,JOIN(",",FILTER(A2:A, B2:B=r)))))),","))
Another solution using REDUCE:
=REDUCE("recipe used",D2:D10,LAMBDA(a,c,{a;FILTER(A2:A10,B2:B10=c)}))

Is it possible to give a cell a different value than it displays?

What I mean by this is maybe explained easiest with an example:
I habe a list of items and every item has a name and an ID.
I want to sort that list by ID, with the exception to have item "XYZ" with ID 24 alwas on first place. So I would like to give it's ID-cell the value 0 (for sorting) but it should still show the value 24.
Sounds weird and is probably not possible?
Edit: I want it to look like this:
If the user is sorting (using the filter drop down menu) by ID column, it should be sorted as it's in this picture.
I found a solution for the first ID (Hans): Custom number format for that cell:"0;0;"24". It will show the value 0 as '24'. That doesn't help for Franz tho. Here I want a value between 5 and 7 showed as '??'.
A possible solution would be creating a second ID and sorting the values based on this new ID. Something like this:
If you are sorting through formula in other columns you can use:
=SORT(A2:B,MAP(B2:B,LAMBDA(id,IF(id=24,0,id))),1)
Exclude that first item from sorting then merge again. Try the following formula.
={A1:B2;SORT(A3:B,2,1)}
Built an array youself for sorting with IF(A1:A7=24,0,A1:A7), so that XYZ will have its weight as 0,
place it next to your data as the 3rd column with {},
use QUERY() to sort the data and get rid of the 3rd column.
Formula:
=ArrayFormula(
QUERY({A1:B7,IF(A1:A7=24,0,A1:A7)},
"Select Col1,Col2 Order By Col3 ASC",
1)
)
I found the solution (with a little help):
For only the cells you want to show "Something else" but be handled as the values, edit the Custom number format to:
By this, it will always show what you put in there, no matter what value the cell has.

ag-grid columnsMenuTab customization

I am trying to customize the columnsMenuTab display in ag-grid to hide certain group header rows from being shown. We have a column group hierarchy that looks something like:
Name
Type Name
Formula
Column Name
We'd like to hide the Formulas from being displayed inside the columnsMenuTab so that when the user is toggling the column visibility they don't see the formulas but they can still see the column name. The end result would be something like:
Name
Type Name
Column Name
Looking through the documentation (https://www.ag-grid.com/javascript-grid-column-menu/) I was not able to find a way to achieve this customization.
We are using ag-grid-react (enterprise) 21.0.1
Thanks.
05/18 Edit: Added some clarification as to the end result.
You can use suppressColumnsToolPanel: true for the column you dont want to show up in columnsMenuTab as well as the tool panel that shows up on the right.
This works for column or column group in the hierarchy and should work for Formula column in your case.
As per docs-
suppressColumnsToolPanel Set to true if you do not want this column or group to appear in the Columns Tool Panel. Default: false
Still works in #ag-grid-community/core#^28.1.1 #ag-grid-enterprise/column-tool-panel#^28.1.1
I set suppressColumnsToolPanel: true on one of the columns and this column does not appear in the column menu > column selection tab anymore.

IF returns certain value if cell contains a certain phrase, but no blanks/N/A in between

I've tried looking for an answer to this online for a few hours now, but I just can't work out how you'd describe it, or find an appropriate answer.
I have a spreadsheet where I'm wanting to pull out an ID in Column A into a separate tab, but only if it contains a certain phrase that's contained in Column E. In this separate tab, I then don't want there to be any gaps in between the IF statements.
So for example I want the next tab to pull through the Action ID if column E contains 'Client'. If it doesn't, it searches the next row and so on until it finds one that does contain 'Client'. Row 2 on the separate tab would then continue the search, but it wouldn't be filled with something if it doesn't find the word 'Client' - it instead would continue searching down until it found one that has the word in.
So for example - if the first ID that contains the right phrase is in Row 5, I want it to appear on the separate tab in Row 2, underneath the heading. Then, if the second ID with the correct phrase in column F is in Row 11 for example on the main tab, I then want it to be pulled through to Row 3 on the separate tab. And so on..
This will then allow me to do lookups for the rest of the values I want to input on the separate tab.
I've tried as many different IF statements as I can, but it's just not having it.
Any advice would be really appreciated.
You can use INDEX and AGGREGATE combination:
=IFERROR(INDEX($A$2:$A$6,AGGREGATE(15,6,1/($E$2:$E$6="Client")*ROW($E$2:$E$6)-1,ROW()-1)),"")
In Google Sheets you can use FILTER (docs) for that. Place it in the top cell of your column.
={
"Your Header";
IFNA(FILTER(A2:A, B2:B = "Client"))
}
If A2:A and B2:B are from other tab named My Tab it will be 'My Tab'!A2:A and 'My Tab'!B2:B.

How can I filter my search in a column on google sheet which collects data from a form?

I would like to perform a multi criteria search of data in a column- contains data of check boxes(more than one option chosen).
For a clearer picture of what I am trying to do, screenshot below is a question in a form
Data from the form are saved in sheets like below,
So my concern here is if I would like to search/filter for the rows that contain "Commercial", the rows with Commercial,Engineering doesn't show up. That's definitely not an effective search.
Any advise on how can I go about this issue is kindly appreciated. If
Let's say you have your form in the response sheet in columns A to P, with the multiple choice in col D. If you want to filter your data on the word 'Commercial' you can either do:
=filter(A2:P, regexmatch(A2:P, "Commercial"))
or use query():
=query(A2:P, "select * where B contains 'Commercial' ")
Note: depending on your locale you may have to change the commas to semi-colons in order for the formulas to work.
I hope that helps ?
Following JPV's answer, I developed a line to make the query useful if you want to cross two categories. Let's suppose that someone in your checkbox example had picked all the options (IT, HR, Commercial, Engineering); and that you have created the cell with the dropdown option box in cell B1 with all your options, as JPV said.
Then, you want to filter and see all the people who had chosen IT and Commercial. You would, for that, create a second cell with the dropdown option box in, lets say C1; and then your query would be:
=query(A2:P, "select * where B contains '"&B1&"' and B contains '"&C1&"' ")
=FILTER(MOBILE!A2:E2000, ISNUMBER(SEARCH(A1,MOBILE!A2:A2000)))
SEARCH function will return a number of the position of the searched word (A1) in the searched strings in range (MOBILE!A2:A2000).
If the result of search is a number (ISNUMBER), then filter will return the TRUE rows result from the range MOBILE!A2:E2000.

Resources