I have a list of values in three different sheets that are dynamic in column A, I have to put merge the three of them into a main sheet big list.
In the image the color squares are the different sheets and in the right is the merge sheet where I need this merged list with the values from all the other sheets something like this:
use:
=FILTER({'Sheet 5'!A:A; 'Sheet 6'!A:A; 'Sheet 7'!A:A};
{'Sheet 5'!A:A; 'Sheet 6'!A:A; 'Sheet 7'!A:A}<>"")
There are different ways to do that.
=QUERY(C:C,"select * where C is not null")
You can use FILTER() function like
=FILTER(C:C,C:C<>"")
Try this
=query({Sheet1!A1:A;Sheet2!A2:A;Sheet3!A1:A},"where Col1 is not null")
or
=query({Sheet1!A1:A;Sheet2!A2:A;Sheet3!A1:A};"where Col1 is not null")
according to your locale
Related
I have the following query in M:
= Table.Combine({
Table.Distinct(Table.SelectColumns(Tab1,{"item"})),
Table.Distinct(Table.SelectColumns(Tab2,{"Column1"}))
})
Is it possible to get it working without prior changing column names?
I want to get something similar to SQL syntax:
select item from Tab1 union all
select Column1 from Tab2
If you need just one column from each table then you may use this code:
= Table.FromList(List.Distinct(Tab1[item])
& List.Distinct(Tab2[Column1]))
If you use M (like in your example or the append query option) the columns names must be the same otherwise it wont work.
But it works in DAX with the command
=UNION(Table1; Table2)
https://learn.microsoft.com/en-us/dax/union-function-dax
It's not possible in Power Query M. Table.Combine make an union with columns that match. If you want to keep all in the same step you can add the change names step instead of tap2 like you did with Table.SelectColumns.
This comparison of matching names is to union in a correct way.
Hope you can manage in the same step if that's what you want.
Having some trouble with a very simple problem. I want to create 1 list in a column based on data from two different columns, I only want each item to appear once in the list column.
So to create the list based on data from one column, I used this formula but I don't know how to do it from 2 (and the number of occurrences/count isn't needed).
=ArrayFormula(QUERY(J2:J&{"",""},"select Col1, count(Col2) where Col1 != '' group by Col1 label count(Col2) 'Number of occurrences'",-1))
https://docs.google.com/spreadsheets/d/1loPw3eUALLKx3NzXrxhDszqD2_B7G3cyH1EhnYg4tFg/edit?ts=5cf63f94#gid=0
Maybe something like:
=sort(UNIQUE({A1:A10;B1:B12}))
If your locale uses , as separator, the lists are in A1:A10 and B1:B12 and you want the result sorted.
Is it possible to create a custom ORDER BY function in a google sheets QUERY?
In this scenario, I don't want the results to be alphabetical nor numeric, but rather a custom order based on a predefined category list that is actually in a separate tab from both the QUERY range as well as the formula itself.
I'm not really sure where to begin: Is this even possible? Should the category list be moved to one of the other sheets? Does the category list need to be written into the formula?
Just looking for guidance at this point.
My Sheet
=ARRAYFORMULA(ARRAY_CONSTRAIN(QUERY({QUERY({Estimate!A2:H},
"where Col1 is not null"), IFERROR(VLOOKUP(QUERY({Estimate!A2:A},
"where Col1 is not null", 0),
IF(LEN(A5:A), {A5:A, ROW(A5:A)}, ), 2, 0))},
"where Col1 is not null
order by Col9", 0), 999^99, 8))
I have some table data in which I'd like to sum all the values in a specific column of all rows where column A contains string A and/or column B contains string B. How can I achieve this?
This works for one criterium:
=SUM(FILTER(G:G,REGEXMATCH(F:F,"stringA")))
I tried this, but it didn't work:
=SUM(FILTER(G:G,OR(ISTEXT(REGEXMATCH(F:F,"stringA")),ISTEXT(REGEXMATCH(C:C,"stringB")))))
Please try:
=SUM(FILTER(G:G,REGEXMATCH(F:F,"stringA")+REGEXMATCH(C:C,"stringB")))
+ works for or logic. ISTEXT is not needed because REGEXMATCH gives true or false.
OR does not work because filter is an arrayformula, use + in array formulas.
=SUM(FILTER(G:G,REGEXMATCH(F:F&C:C,"stringA|stringB")))
OR is denoted by |
EDIT Added &C:C to denote different Columns
I've a dataset like this:
I need to join only the last three columns (the authors) and the join function is not helping me. I don't have always 3 authors: they can be 2, it can be 1.
Is there a way to join only the cells which have empty cells in the near column?
A solution a bit simpler is to use slice() to select all values on each record except the first one :
row.record.cells['Column name'].value.slice(1).join("|")
Well, I used a workaround:
first I add another column with row.record.cells.NameColumn.value.join("|")
then in the new column I eliminated the book title doing value.replace(/(^[^\|]+)\|(.+)$/, "$2")