Openrefine: How do I delete multiple rows by a specific column value? - openrefine

I have about 200 rows of different starbucks coffee drinks and the firs column is calories with certain values that have "-" as opposed to a number. Would it be possible to delete all of the rows that have a value "-" in the calories column all at once?

You can select the affected rows by either a text facet or a text filter.
To delete the selected rows you can use the "All" dropdown left of the data columns via "All" => "Edit rows" => "Remove matching rows".

Related

Coldfusion loop and remove rows if a particular row type exists

column names: mastertransid, type_internal_id_int
Query returns 3 rows. For type_internal_id_int the value can either be SalesOrd, ItemShip or CustInvc
mastertransid is the same for all 3 rows and groups the three together
However if there is a record for type_internal_id_int and it = CustInvc then I need to hide the other two rows.
I've tried grouping my data using <cfoutput group by="type_internal_id_int"> without any luck.
From the image I have included, I don't want customers to see SalesOrd or ItemShip, if a CustInvc value exists.

Calculating the number of like records in an unbound text box on a form. in MS Access 2016

I have an unbound text box [txt_AmendmentOF] on a form to count the total number of Amendments a specific record has in the database. So the user knows which amendment they are on. Just a simple you are on Amendment 3 out of 8. i have this calculation i am using in the Control Source field of the text box [txt_AmendmentOF]:
=IIf(IsNull([txt_Amendment]),0,Count([MIPR_Number]))
there is a Field on my table called [Amendment] its text box on the form is called [txt_Amendment]. I have the calculation return a zero in [txt_AmendmentOF] if [txt_Amendment] is null. I need it to count the record number [MIPR_Number] that are the same and return the total number of Amendments count in the [txt_AmendmentOF] text box. on my table i have private key field called [ID] it is an autonumber format. The problem with the code above is it is counting all the fields that have a [MIPR_Number] and returning the total row count of that. i am not an expert here so any help would be greatly appreciated.
Update to post..
I have also tried this and got an error in the text box
=IIf(IsNull([txt_Amendment]),0,Count([MIPR_Number]=[txt_MIPR_Number]))
Counting by a condition is one of the basic dataabase tasks. To get answers from a db, you have to query the database (and that is done by createing a query).
To count same[MIPR_Number]you have to group the data (a group contains same numbers), then count.
SELECT COUNT(id) as CountOfSameNr, [MIPR_Number] FROM Table GROUP BY [MIPR_Number]
Store this query as e.g CountMIPRNumber.
Now you have two options:
Use a Dlookup to get one value
=IIf(IsNull([txt_Amendment]),0,Dlookup("CountOfSameNr","CountMIPRNumber","[MIPR_Number] = " & [MIPR_Number]))
or add the query to form recordsource (join on [MIPR_Number], "SELECT * FROM TABLE" is forms query)
SELECT CountMIPRNumber.CountOfSameNr, TABLE.* FROM TABLE LEFT JOIN CountMIPRNumber ON TABLE.[MIPR_Number] = CountMIPRNumber.[MIPR_Number]
and reference the count field
=IIf(IsNull([txt_Amendment]),0,[CountOfSameNr])

Retrieving Columns with count greater than 1 - Google Sheet Query

I'm using Google sheets, and I want to get the data from one sheet to another where I want only the columns with count > 1.
Let's say we have 3 columns A, B, and C. I tried the following (the first sheet name is "Form Responses 1"):
I thought about using a query in the second sheet as: =query('Form Responses 1'!A1:Z, "Select A having count (A) >1 union select B having count (B) >1 union select C having count (C) > 1"). But I got a parse error where it seems that union and having are not supported in google sheets query.
How can I achieve this (whether it's using query or any other Google sheets function that can work)?
More details:
The first sheet contains info about exercises conducted during a lecture and it gets its data from a Google Form (so the responses are fed in this sheet). Here is a screenshot of it:
Please note that the form is divided into sections. When the user selects the course, the attendance, the participation, and adds a comment, then they go to the next section, the next section will be based on the selected course, the newly opened section will have the exercise name and rating questions (the exercise name is a dropdown list with items that are prefilled and specific to the selected course). That's why, you can see that "exercise name" and "rate the exercise" columns are repeated because we have 2 sections in this form.
The second sheet should contain the data of a selected course only (either mobile dev or web dev) which can be achieved easily through a query with a where clause. But, in addition to that, it shouldn't contain the empty columns of "exercise name" and "rate the exercise" as they correspond to another section. So, it should have only one exercise name column and one rating column that correspond to the selected course. Here is a screenshot if we only use a query with where clause without removing the extra name and rating columns:
Here is a screenshot with the desired result:
Thanks.
why not use just:
=QUERY('Form Responses 1'!A1:Z, "select A,B,C,D,E,F,G where F is not null", 1)
Use "OR" condition
Eg:-
QUERY(Data!A:R,"select A, N, P where N>0 or P>0")
where A column has country and N, P columns have population values

How to perform sql query on sheets of excel

I have two tables in excel(sheets) . One has 10,000 entries , another has 1000 entries . Both of them have account number column in common . I want to select only those row in 10,000 entries which have their account numbers specified in 1000 entries table. An easy way is preferred .
Use advance filter as stated in the comments.
Go to: Data -> Sort & Filter -> Advanced
Select Filter the list, in-place
Select the 10,000 list account numbers as List range
Select the 1,000 list account numbers as Criteria range
That should provide the list you are looking for. No sql needed.

Calculated Items in Excel: How to check if a field contains a particular item

As part of my VBA script I'm trying to add a calculated item to a pivot field as follows:
myPivotTable.PivotFields("Validity").CalculatedItems.Add "Valid %", "=ROUND(('Rejected'+'Duplicate')/('Valid'+'Rejected'+'Duplicate') * 100, 1)"
In my source data table amongst other columns I have a 'Validity' column (the name of the field) with rows of data that can contain the values 'Valid' or 'Rejected' or 'Duplicate'. The above line will work fine when the source data column contains at least one row for each of those values.
Sometimes though my data set doesn't contain a row with 'Duplicate' so I get an error 400 when this is run.
I tried to use the IFNA, IFERROR functions to try and return 0 like this but this produces the same error:
myPivotTable.PivotFields("Validity").CalculatedItems.Add "Valid %", "=ROUND(('Rejected'+ IFNA(0, 'Duplicate'))/('Valid'+'Rejected'+ IFNA(0, 'Duplicate')) * 100, 1)"
How can I fix this?