Filter row and populate - arrays

I have a form response sheet with different columns. I have a region column for every country. But when you respond to the form you have to select only one country. So in my sheet every row has only one country column filled. I would like to filter every row (and populate to automatically have new responses filtered) to have a new column with the region selected.
Sheet expected
In this case I only have 3 countries but in the real case I have about 40 countries.
Thanks for your help

try on row 1:
=ARRAYFORMULA(TRIM(TRANSPOSE(QUERY(TRANSPOSE(A:C);;999^99))))

Related

Single cell selection as input in ag-grid

I am using ag-grid in an angualar project to display a list of input parameters for a user to select. However, so far I am only able to show this list as distinct rows. And every time user has to select one cell, he has to select the entire row. I have not found any single cell selection as user input in ag-grid documentation so far. Any other ideas?
This is how I would like to have my UI look in angular using ag-grid so that the user can select one or more cells per column (Data category) as input
Data Catagory A
Data Catagory B
Data Catagory C
ParamA_1
ParamB_1
ParamC_1
ParamA_2
ParamB_2
ParamC_2
ParamB_3
ParamC_3
ParamB_4
But currently, this is all I have come up with - distinct separate rows per input value for each of the columns :
Data Catagory A
Data Catagory B
Data Catagory C
ParamA_1
ParamB_1
ParamA_2
ParamB_2
ParamB_1
ParamB_2
ParamB_3
ParamB_4
ParamC_1
ParamC_2
ParamC_3
And subsequently, the entire row/rows are selected as input by the user.
Most of the ag-grid documentation talks about row selection or range selection, but I couldnät find anything that talks about multiple cell selection in different rows and columns (not a range of cells)

Index Match in Array in Google Sheets

I have a spreadsheet 'Database' where there are two columns, 'Countries' (A) and 'Companies'(B). Countries are numbered from 1-10. Companies are labelled with letters.
The spreadsheet tracks the companies that operate in each country. As such, a row that has Country 1 in column A and Company A in column B means that Company A operates in country 1. This is a screenshot from this spreadsheet:
I then have a second spreadsheet called 'Countries by Company' where I would like to list the countries in which a company operates. I would like them to be listed in different rows starting form cell B3 of the 'Countries by Company' sheet. The company name for which the countries should be listed is in cell B1 of the same sheet. I gather this has to be done with an ARRAY version of an INDEX MATCH function but I can't seem to get it to work.
I have put the following formula in cell B3 of the 'Countries by Company' sheet: =INDEX(Database!$A$1:$B$76, MATCH($B$1, Database!$B$1:$B$76, 0), COLUMN(Database!A:A)). However, as expected, it will only return the first country in which the company in cell B1 operates and no other country. Again, I would need all countries in which that company operates listed in different rows from cell B3.
I have set up a sample sheet in here. I thought it might help in case I wasn't too clear.
Thanks for your help!
Using FILTER allows restricting the values on the Database sheet to only those that match a given criteria:
=FILTER(Database!$A:$A, Database!$B:$B=$B$1)
yields every country index for the given company index on the Database sheet. If only the country index values (e.g. 1, 3, 6) are desired, rather than converting those index values to a name or other property that is held in a hypothetical "Country DB" sheet, the above FILTER is sufficient.
If additional information is desired, then VLOOKUP can be used to return the corresponding values for multiple inputs (i.e. an array input):
B3: =ARRAYFORMULA(VLOOKUP(
FILTER('Database'!$A:$A, 'Database'!$B:$B=$B$1), // Searched values
'Country DB'!$A:$B, // Database sheet having more country information (like name, gdp, ...)
2, // Column of the desired information
FALSE))
will yield the 2nd column from each corresponding country index row in the "Country DB" sheet:
Try using Filter
=filter(Database!A2:B,Database!A2:A=B1)

Repeat Header Row With Each Row In the Table IN SSRS

I have a report in SSRS and I want it to display like this (header row repeats per data row):
Id Name
1 John
Id Name
2 Jack
How can I do that?
I have a row group which creates a new record for every new value of Id, but I can't get the header row to display before each record.
Don't use an actual header row. Add another row to your details group, and set the data in that row to be static text. (Type directly into the cell.)
The entire details group, no matter how many rows, will be repeated for each record in the dataset.
The details group is indicated by the small lines to the left that I circled in the screen shot below.

Drupal Commerce dynamic Line Items

Is there a way by which I can programmatically update a select options list of LineItems?
I am trying to create Line Items from data provided by site administrators.
If you refer to http://178.79.128.76/coronet/node/78, you will see 4 types of data: The Viewing date, The Viewing options, Add to cart button and Show Times.
The Show Times data is unique for each product. Each entry consists of a date and one or more time(s).
The Viewing Options is a line item and I am trying to populate it with data extracted from the Show Times field in the following format:
Viewing Date 1 + ShowTime 1
Viewing Date 1 + ShowTime 2
Viewing Date 2 + ShowTime 1
Just for demonstrating my objective, I populated the example data above in my Viewing Options Line Item using hook_form_alter - they don't actually work when you select and attempt to add the product to.
You can have your tables set up with LineItem table, a ViewDate table and a ShowTimes table. That will allow you to have a ViewDate collection with a foreign key to the LineItem, and a ShowTimes collection with a foreign key to the ViewDate.

Backbone.js Model with 2 parents

I would like to create a backbone based page where there are undefined amount of columns and rows in a table-like layout. The 'table' structure and cell data should be saved to the backend.
The simplified models are:
row:
id
label
column:
id
label
cell:
rowID
columnId
value
in this situation a cell belongs to one row and one column.
If I add rows and columns dynamically how will the cells know what their rowID and columnId is especially in case of a newly added row+column which is not saved yet?
An other question is how I can connect a row of cells to a row object and at the same time a column of cells to a column object?
Thank you in advance, please let me know if you need more details.
I would forget the concepts of rows and columns and just use index position for your cells.
If you have C columns and R rows, the cell at position Column = 2 and Row = 3 would be at position (3 - 1) * C + 2
This allows you to easily deal with changing numbers of columns and rows. You can also dynamically recalculate all objects that belong to a row or a column and then create object and row columns.

Resources