How to add additional column showing sheet names & row source in query importrange function (google sheet) - google-sheets-formula

I have a query importrange function to combine hundreds of my sheet into 1 new googlesheet file, but i need an additional column which show sheet/tab source name and the row source.
this is my query so far :
=QUERY(
{IMPORTRANGE("SheetID-1","Sheet1!A5:Y1000");
IMPORTRANGE("SheetID-2","Sheet2!A5:Y1000");
IMPORTRANGE("SheetID-3","Sheet3!A5:Y1000")},
"SELECT * WHERE Col2 IS NOT NULL Order By Col1", 0)
my query is like that (but for hundreds different sheet) and now i hope i can added aditional column in column Z that showing the source tab/sheet name with row :
Example :
Column Z : Sheet1 - Row 7
If i using filter i can add the additional column with the source row & sheet name like that, but im have no idea to add the column using query. Need some help here.

Related

Power Query - Modify tables before combining them

On my table (point1) I am trying to get, that for each table of the grouped rows (point 2) I will have new row inserted (point 3) at the beginning of each table with the value in the column "Metadata1" equal to value form "Column2" for original row number 2 (starting counting from 0).
Link to excel file:
https://filebin.net/cnb4pia0vvkg937g
Its hard to know how much of your requirement is generic or specific, but
TransformFirst = Table.TransformColumns(#"PriorStepName",{{"Count", each
#table(
{"Column1","Column2","Metadata1"},
{{_{0}[Column1],_{0}[Column2],_{2}[Column2]}}
) & _
}}),
Together=Table.Combine(TransformFirst[Count])
in Together
modifies all the tables in column Count to include an extra row that is made up up Row0/Col1 Row0/Col2 and Row2/Col2
It then combines all those tables into one table

Filter for many columns with dynamic data

I need a help.
I am using Tableau for visualisation. Data in my DataBase are structured by unique keys (+1k rows). I need to filtered value from rows by 2 and more columns (2columns+_filter). And this filtered data must be react to other Filters ("category") on My_Dashboard.
What I used:
Combination from Parameter and Calculation Field.
Parameter - includes data from 2 and more columns (I added it manualy).
Calculation Field - based on Contains(Column1, Parameter) OR... to the last column.
But it doesnot work, because Parameter included data what could be excluded by Filters on My_Dashboard.
Is it possible make a "dynamic filter" what will be select data (rows what inludes "value_1" from range column_1-column_3 after applying Filter - "category1" only.
For example - Input:
rows
column_1
column_2
column_3
column_4
row_key_1
value_1
value_5
category_1
row_key_2
value5
value_1
category_2
row_key_3
value_5
category_1
Output:
rows
column_1
column_4
row_key_1
value_1
category_1
Mayth be it possible with SQL addon/plugin, or something other.
Thanks for your help.
I understood how can realise what I want. If you have the same task, what you need:
add two DataBase (or sheets from excel, etc.) and connect them with unique key "first_db_key = second_db_key";
first DataBase sctuctured by horizontal, 1 row with unique key and a lot of columns with value;
second DataBase sctuctured by our target column (included all possible values waht we need) and ofcourse rows with "unique key" from "first DataBase" could be repeated (2 or more).
on you Sheet need to add filter based on "target column" from "second DataBase", after that, add filter to the "Context" and choose "All using this data source" option on "Apply to Worksheets" in context menu (rigth button click on the filter)
on you Dashboard select to show filter what you added before, and in filter menu choose "All Values in Context" option.
Finaly you are get result what you want.

How to auto-create row space / spacial definition between rows with different column values?

I want to create a row, or some kind of definition, between Google Sheets rows whenever one of the value in my columns contain a new / different value.
Here's an example of the kind of spreadsheets I'm putting together, which shows how Agencies are listed in Column A, and Sub-Agencies are listed in Column B.
I'd like to create some kind of row space / spacial definition between every new / different Sub-Agency, which are values that I enter in Column B of my spreadsheet -- but no space between rows with the same Sub-Agency value. Here's an example of the kind of row space / spacial definition that I'm seeking.
Any ideas / suggestion on how do this?
Many thanks for your help!
You can insert a row after X condition.
Using insertRowAfter(afterPosition) inserts a row after the row you want:
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
// This inserts a row after the first row position
sheet.insertRowAfter(1);

SSRS - T-SQL - Concatenate multiple rows

I have T-SQL query that joins multiple tables. I am using that in SSRS as Dataset query. I am only selecting two columns, ID and Names. I have three records with same "ID" values but three different "Names" values. In SSRS, I am getting the first "Names" value and I need to concatonate all three values with same ID and have it in one cell on a table.
How would I go about doing that?
I am using lookup to combine cube + sql
Pulling ID straight from a table but using Case statement for Names to define alias.
You can accomplish this in TSQL either using PIVOT to get them as separate columns which you can then combine in the report cell, or you can use one of these concatenation methods to get all the names in one column.
For example, you can do this:
SELECT SomeTableA.Id,
STUFF(
(SELECT ',' + SomeTableB.Names AS [text()]
FROM SomeTable SomeTableB
WHERE SomeTableB.Id = SomeTableA.Id
FOR XML PATH('')), 1, 1, '' )
AS ConcatenatedNames
FROM SomeTable SomeTableA
INNER JOIN AnotherTable
ON SomeTableA.Id = AnotherTable.SomeId
...

facing problems while updating rows in hbase

I've run samples : SampleUploader,PerformanceEvaluation and rowcount as given in
hadoop wiki: http://wiki.apache.org/hadoop/Hbase/MapReduce
The problem I'm facing is : table1 is my table with the column family column
>create 'table1','column'
>put 'table1','row1','column:address','SanFrancisco'
hbase(main):020:0> scan 'table1'
ROW COLUMN+CELL
row1 column=column:address, timestamp=1276351974560, value=SanFrancisco
>put 'table1','row1','column:name','Hannah'
hbase(main):020:0> scan 'table1'
ROW COLUMN+CELL
row1 column=column:address,timestamp=1276351974560,value=SanFrancisco
row1 column=column:name, timestamp=1276351899573, value=Hannah
I want both the columns to appear in the same row as a different version
similary,
if i change the name column to sarah, it shows the updated row.... but i want both the old row and the changed row to appear as 2 different versions so that i could make analysis on the data........
what is the mistake im making????
thank u a lot
sammy
To see multiple versions of the same row, you need to specify a VERSIONS option:
get 'my_table', 'my_row_key', {VERSIONS -> 4}
When the hbase shell prints out
row1 column=column:address,timestamp=1276351974560,value=SanFrancisco
row1 column=column:name, timestamp=1276351899573, value=Hannah
That's a single row with multiple columns. The text representation just happens to use multiple lines of text, one per column.

Resources