Filter all rows in a column in body for API call using POSTMAN - url

I would like to know for a search filter what should be the ideal way to list all types of values from a column using the search term - (search.in(GameType,'Multiplayer' , ',')) from body in POSTMAN. From what I've seen boolean operators are used to filter multiple columns in a table, but for a single column there are implementations for specific values like above. Precisely, I want all the types from the column Gametype in my search. Can you share some thoughts/ideas on this?

Related

Advanced filter/configurator based on dataset

I would like help with a problem, or rather a challenge in Excel and/or Google Sheets.
What we want to develop is as follows:
We have a table of products and certain attributes. Now we want to create a kind of search function based on this table.
Example:
Let me give a simple example. Suppose you have as a product an apple, a banana and an orange. The characteristics associated with these are size, color country of origin. We then want a search function, where you indicate one or more preferences, i.e. size, color and/or country of origin and that based on those criteria, all products that meet these criteria are displayed.
So if you specify oblong as the size and do not specify any other criteria, it only shows "Banana. If the banana and the orange have Holland as their country of origin and you only give Holland as the criteria country of origin, it will show 'Banana' and 'Orange'. If you say country of origin Netherlands and format oblong, it again shows only 'Banana'
See below an image of our document and how we would like this to look approximately.
Currently, there is no existing formula, because we simply do not know if this can be done and how best to do it.
The document can be accessed at:
A copy of our document with sample data:
Document
ADDITION:
Hi, Unfortunately I still am not able to get it to work. I am not really a hero in coding/functions. I created a bit more of a clear view in my file and also set the language of my sample file to english. You can find it here: Sample
What I actually need is just that it shows the data on 'Datasheet' if conditions on the left (parameters/value) are met, but only if they are filled. Probably easy one for you, hard to me haha Could you help me out once more? –
Your question is very generic, I will try provide here some guidelines on how to achieve it in Excel or Google Sheet based on my own experience. The approach used for Excel can be used for Google Spreadsheet, since it is based on FILTER function that both tools have but with different signature. For Google Spreadsheet you can also use QUERY that is very powerful for situation like this.
In all cases, it is a good practice to have a sheet with the input raw data (let's say Input tab), then in second sheet the working data of filtered data (let's say WorkData). This is specially relevant when the raw data is big dataset, so you don't touch the original data set, and instead you have the filtered data in a separated tab.
Both tools offer filter features in the UI or slice. This is something to consider, but using Excel/Google Spreadsheet functions, you can show the filter parameters in a more friendly manner, because you can see the parameters selected without additional click to find what filter values where selected. The approach here is based on Excel/Google Spreadsheet functions.
Excel
Let's say you have a block of filter conditions that you want to apply to a range of data. You can use data validation list so you can select a subset of possible values for each of the filter conditions and then to concatenate such conditions logically (OR or AND) using multiplication of addition.
=FILTER(dataset, condition1 * condition2...conditionN)
where each condition is based on the filter value you want to restrict and each condition represents an array of {TRUE,FALSE} values all of them of the same size as dataset (number of rows).
I use some wildcard values to represent all values of the column, in my case I use ALL, but you can setup in a different way. In such case the filter doesn't take effect, but we want to make it work when a specific value is selected. The following trick can be used for both scenarios.
IF(B3="ALL", D3:D15<>"*",D3:D15=B3)
indicating that if B3 is equal to ALL, then the condition to select all of the D3:D15 rows is the following: <>"*". Otherwise select only the rows equals to B3.
Sometimes I would like to consider OR conditions for a given filter condition, for example for a given filter condition, consider value1 or value2 and it is represented in the filter value as a list of values delimited by comma, for example: value1, value2.
Here, some Stack Overflow questions I posted with answers about how to deal with that:
Filter an excel range based on multiple dynamic filter conditions
Filter an excel range based on multiple dynamic filter conditions (with column values delimited)
Google Spreadsheet
The FILTER function here, allows to add the filter conditions via input arguments, so now we have:
=FILTER(dataset, condition1, condition2...,conditionN)
Note: Keep in mind in Google Spreadsheet we don't need to add the conditions by multiplying each one of them. It is added via input argument.
here you can check some of question I posted related to this topic:
Using ARRAYFORMULA with SUMIF for multiple conditions combined with a wildcard to select all values for a given condition
Using ARRAYFORMULA with SUMIF for multiple conditions combined with conditions using a wildcard. Result by Months
In some cases it is better to use QUERY function.
Here, a sample file using QUERY statement and how to combine multiple conditions inserting IF in the where statement.
sample query on C1 cell:
=query('Jira Issues'!$A:$T, "where "
& IF(B2="", "G is not Null", "G >= date '"
& TEXT(startPeriod,"yyyy-mm-dd")&"'")
& IF(B3="", "", " and G <= date '"
& TEXT(endPeriod,"yyyy-mm-dd")&"'")
& IF(OR(B4="ALL",B4=""), "", " and A='"&B4&"'")
& IF(OR(B5="ALL",B5=""), "", " and I='"&B5&"'")
& " label A 'Team', S 'Reporter', T 'Assignee',
P 'Env.', I 'Release'",1)
The raw data is in Jira Issues tab, the data populated is based on multiple filter conditions. I am using some name ranges for the filter values for a better understanding of the formula, such as: startPeriod, endPeriod, etc. You can test the actual query will be invoked looking at the result of the consolidated string of the query input argument of QUERY function.
Similarly you can stablish a where statement to consider whether the input parameter is empty or not. In such case, you can build a logic like this inserting an IF block as part of the where statement and concatenate the string result.
=QUERY(Input!A:Y,
"select *" & " where A " & IF(B2="", "<>'*'", "='"&B2&"'")
"and " & " where B " & IF(B3="", "<>'*'", "='"&B3&"'")
,1)
The above query for column A or B, returns the entire column via condition: "<>'*'" if the input parameter B2 or B3 were not specified. In a similar way you can add additional conditions for more parameters, repeating the third line of the query and changing the column and the parameter cell.
Recommendations
Focus on a specific tool: Excel or Google Spreadsheet, even they have some similarities, you need to get familiar with the specifics of each one of them.
Try to start working on your specific problem, once you face impediments, do some research, usually you are not the first person facing this problem, if you don't find a solution, then post your specific problem using a sample as an extract of your real problem (in English, your sample is in other language). Generic questions like this one are difficult to get some attention.

Google Sheets filter() wrapped in arrayformula() without vlookup()

Reference/test sheet: https://docs.google.com/spreadsheets/d/1fp6ZTBtgb5E0J9GKOqh8Ae47OzY1smec5ha9BfUfAsY/edit?usp=sharing
I have a Google Sheets document with one sheet (calculator) that pulls some values from another sheet (database). database is organized by two columns: make, and model. I use some weird data validation and helper columns to make dropdowns in calculator. Then I use filter() to pull the matching value from database.
This all works fine but it will be a calculator that gets reused and the data discarded, so I need only a finite number of rows in calculator (10-20). For this, it would be super nice to be able to select the whole row and hit delete to clear the calculation without destroying all the formulas. Ideally, the filter() would happen inside an arrayformula() in a hidden and protected top row to allow the rows to be easily cleared.
For some reason though, I can't get that to work. vlookup() is not an option because I need to match two keys.
On another note, it would be nice to not need the helper columns B:J and the data validation unique to each row. This is workable though as I only need a few rows. In the actual version I hide and protect B:J and there are many more columns there.
I know you said Vlookup() wouldn't work because you need to match on two keys, I think that vlookup() will help in this situation. Try this formula...
=arrayformula(Vlookup(A3:A&K3:K,{database!A$2:A&database!B$2:B,database!C$2:C},2,False))
The concept here is to put those two matches you need into one unique key. So we use the curly brackets {} to build an array within the formula and combine those two lookup fields in your 'database' sheet. So the columns of A and B become concatenated into one element, and the second part of that array is the column C which you need.
To lookup then just combines your A&K columns similarly, so it can lookup that combined element. The rest of the vlookup follows as normal. I.e. we look up this concatenation against that one and when it matches it returns the second column of the array we built, in this case database!C.
I don't think I'm clear on your columns B:J, so I'm not sure if this helps you with that as well.
You can't get rid of the helper column approach, as long as you want the calculator to use drop down selection for the model. Data validation for dropdowns requires either a list of values, ie. static, so no good, or a range of cells.
What you might want to do is to put those cells in a totally separate tab, eg. DataValidation, and then hide that tab. Your Calculator sheet will then be cleaner, with no hidden columns. Column K will use for data validation the "hidden" values, formerly columns B:J, that are now built off in the DataValidation tab.

Query Importrange in Google Sheets Not Importing Correctly

We are using Google Forms to collect data on our students. They use the same Google Form for all students, but as part of the form, they are asked the students name.
The data that ends up being collected you can see on the tab Form Responses 1 on the Google Sheet linked here.
I am attempting to use ImportRange to create a tab for each of the students. The formula that I am using for just one of the students is...
=QUERY(IMPORTRANGE("1nJANDP1fiQunxfxEf-EjwJrnIRICv6kLhYYY9XBXtD4", "Form Responses 1!A:I"),"SELECT * WHERE Col3 = 'Adam N.'")
You can take a look at the tab called Adam N. and you'll see it is kind of working.
One thing that doesn't seem to be working is when there is a text value in columns E-I, that text value doesn't end up showing on the Adam N. tab. Any ideas how I can get both the numbers and the text values to show up?
The other thing that seems to be a problem is the fact that on the Adam N. tab, the very first row has the same headers as the Form Responses 1 tab, but it also has the very first line of data. Any way to remove that?
Importrange is not needed since you are 'importing' from within the same spreadsheet. Also, I'd recommend using the (optional) header argument in query().
It is often noted that users are tempted to mix data types within a column. The query() function will give undesirable output. If a column is intended for numeric values then only numerical values must reside in that column. Date columns must only contain dates and text columns only contain text values.
This does not mean that numbers cannot appear in a text column as long as they are in a text format. So it is important to plan the columns in a table to make sure this rule is maintained regardless if the data table is created manually or via submissions from a Google Form.
Generally, the query() function will assume the greater number of cell types in a column to be that data type. For example, if there are 100 numbers and 20 text values in the same column then a numeric value will be assumed for that column. There is a good chance the text values will just be ignored. One way to avoid this, would be to convert everything to text.
See if this works
=ArrayFormula(QUERY(to_text('Form Responses 1'!A:I),"WHERE Col3 = 'Adam N.'", 1))

Counting Unique Values with Contain Critera

I've searched all over and this simple principle is apparently not so simple.
BTW I'm using Google Sheets which as you probably know has most of the same functionality as Excel, plus an extra function that might be useful in my case: COUNTUNIQUE()
My "Criteria" is two-fold and required for two different expressions:
Count the unique values that "contain" a string.
Count the unique values that "don't contain" a string.
Consider this data:
A
1 snapple
2 snapple
3 grapple
4 orange
5 orange
6 peach
Criteria 1: Say I want to count the unique values in Column A that contain the word "apple."
In the data above, it should render "2," knowing it should void duplicates.
Criteria 2: Say I want to count the unique values in Column A that don't contain the word "apple."
In the data above, it should render "2," knowing it should void duplicates.
Here's a sheet doc to test: https://docs.google.com/spreadsheets/d/1JYZIhZmSuoWoGvmTFFcBAD1EUQVWvosqBQzkGsbwaOI/edit?usp=sharing
Criteria 1:
=COUNTUNIQUE(IFERROR(QUERY(A:A,"select A where A contains 'apple'",0)))
Criteria 2:
=COUNTUNIQUE(IFERROR(QUERY(A:A,"select A where not(A contains 'apple')",0)))
Original answer:
Criteria 1:
=COUNTUNIQUE(IFERROR(FILTER(A:A,SEARCH("apple",A:A))))
Criteria 2:
=COUNTUNIQUE(IFERROR(FILTER(A:A,ISERROR(SEARCH("apple",A:A)))))
This gives unpredictable results when referencing cells with clickable URLs in. IMO, this is a bug associated specifically with the FILTER function, and how it parses URLs. QUERY works around this because (again, IMO) it will first convert the source data to a single data type (in this case text) in each referenced column.

Criteria - searching against two columns concatenated

I am in need of a way to search against two concatenated columns with a Criteria in a grails project that I've been brought onto. The two columns make up a subject code for a University; a three-alpha-character code and a three-digit number. e.g. AAA123.
My research to date hasn't revealed any straight forward solutions because I have the following requirements:
I need to use Criteria for the PagedResultList as the UI (Javascript/Ajax) works off the paged list and totalCount.
I need to be able to use a wild card search, if the user searches for the alpha code (all subjects starting with 'AAA') or the specific subject ('AAA123').
e.g. subj_code = '%AAA%' or crse_numb = '%123%' or subj_code || crse_numb = '%AAA123%'
What I've found so far is that:
a) With Criteria, I cannot concatenate the columns (unless I've missed something)
b) I cannot use transients to join the columns
c) I cannot use findAll or where because they do not return PagedResultList.
If anyone knows of how to perform this using criteria or returning a PagedResultList, I'd be forever grateful.
In this formula property can help you because formula can participate in queries and it is transient by default.
Steps-
Create a formula property and concatenate your strings there.
use this formula property in your criteria query.
Use this post for writing formula property.
Hope this help

Resources