Expression to Exclude rows that have a specific column blank - case

I want to exclude entire rows that have blanks for a specific column....I dont want to show a row that has the first name column as a blank...I was thinking maybe a case statement would help with this
case when [First Name] = blank then exclude???

If this is SQL, in general you could do this:
SELECT *
FROM myTable
WHERE myCol IS NOT NULL

I had to add a calculated column that would be used as a flag, and then filter on the flag.
if(Len([First Name])>0,1,0)
Now I am able to filter on the calculated column to show only rows that have 1 in it (which will be the rows where First Name is not empty).
This doesn't delete the row from the dataset, but has the same effect in visualizations as if it had been.

Related

How to shift rows down based on value in column R?

I have a data frame that looks kind of like this...but much larger
I want to look at the record_id column and shift the right side columns down when the row says admin_time. Then make that previous row NA. Then when I write it to a csv, I'll just use the na = "" to make those cells blank
For example, in the first few rows, it would look like this...
No need to try to recreate the data frame. I was thinking maybe a for loop would work with an embedded if statement to review the patient_id, record_id, and pk_day. I was just looking for alternate suggestions or how to use a statement within the loop to pick out the admin line and do what I mentioned above

How to get IMPORTXML/IMPORTHTML result data in one cell?

Working with Google Sheets, scraping from an html table like this:
I want to get all the rows in JUST ONE CELL...
like this:
And I couldn't get the way to do it!
The expected result is to get all the table data in an unique cell...
replacing columns division, just by a blank space
and converting rows to simple text lines.
Any help, please? =(
NOTE: First values not always include de ":" character. Number of rows in table may vary.
Building from the previous answer you can try:
=QUERY(TRANSPOSE(ARRAYFORMULA(CONCAT(QUERY(TRANSPOSE(importxml_formula),,9^9),CHAR(10)))),,9^9)
Explaining the breakdown:
QUERY(TRANSPOSE(importxml_formula),,9^9)
This returns a table with one row with the number of columns as rows in the original table, with the result of each column is the data of each row in the table.
ARRAYFORMULA(CONCAT(QUERY(TRANSPOSE(importxml_formula),,9^9),CHAR(10))
Each column will be appended with CHAR(10), which corresponds to a line break.
TRANSPOSE(ARRAYFORMULA(CONCAT(QUERY(TRANSPOSE(importxml_formula),,9^9),CHAR(10))))
Transpose the table into 1 column, x number of rows, and finally the last QUERY merges the column into a single cell.
Sample Output:
Update:
Your IMPORTXML() already returned a single cell, and since they can be split by double space, you can use this formula instead:
=QUERY(ARRAYFORMULA(CONCAT(TRANSPOSE(SPLIT(IMPORTXML(A1,B1)," ",,FALSE)),CHAR(10))),,9^9)
try:
=INDEX(SUBSTITUTE(SUBSTITUTE(QUERY(SUBSTITUTE(FLATTEN(QUERY(TRANSPOSE(
your_formula_here
),,9^9)), " ", "×"),,9^9), " ", CHAR(10)&CHAR(10)), "×", " "))

Select one row in R, result is a new table

I try to select just one row in my data but the result come out in new data and I can't compute the mean of this, because the header is showing. But when I select the column, there is no problem and I can see the result as a value. You can see the result of the code in the photo that y is in data and X is in the value.
y=mydata[1,]
X=mydata[,4]
enter image description here
you should use rowMeans.
When you select a row you are selecting multiple variables and that results in giving you a dataframe.

Calculating database cell value

My issue is to calculate the division of one column and another column and to return it to new column in the database.
So each one of the cell in one column should be divided with cell that is next to her in other column.
How can I do that?
So in this picture every element of column "izmerenavrednost" and every element of column "ciljanavrednost" should give element in column "ocenavrednosti"
column"izmerenavrednost"/ column"ciljanavrednost"=column"ocenavrednost"
This would help
Update table
set ocenavrednost = ifnull(izmerenavrednost ,0.00)/ ifnull( ciljanavrednost ),0.00)
If I understand correctly, this is what you are after?
UPDATE table
SET ocenavrednost = izmerenavrednost / ciljanavrednost
If you wanted to subtract instead, then it would be this query:
UPDATE table
SET ocenavrednost = izmerenavrednost - ciljanavrednost

count numbers in column not duplicates

I have an XL file with about 5500 lines. One column is all numbers with many repeats like zip codes. How can I count how many numbers are in that column but eliminate duplicates. For example, maybe there are only 250 zip codes in the column. How can I count that?
Select your column then go to Data -> Additional: then select 'copy result to another column', select result position and check 'Only UNIQUE records', it will copy unique records to selected colunm.
Now you can just select all this column and look how much records there are.
The best thing to do is do it in steps.
First grab that whole column of values. Dedupe it. Paste it into it's own column.
Then down the line, put in this formula:
=COUNTIF(F18:F27,G18)
where f18:f27 is the range to check, and g18 is the number to check for. Copy that formula all the way down the list of unique values.

Resources