I have a table and i am using highcharts from table to make highchart but I want its last column to be exculded from the highchart because it has some string value and highchart doesnt accept string value...
My table is like this
<p>column-A Clolumn-B Column-C Column-D </p><br>
abc 2 4 edit<br>
xyz 3 3 edit<br>
pqr 5 6 edit<br>
I want this column-D to be excluded from highchart as it will contain string value and highchart doesnt support string value.....
In the data.src.js you have a description of options. So you can use startColumn / endColumn parameter in data object.
data: {
table: document.getElementById('datatable'),
startColumn:0,
endColumn:2
},
Example:
http://jsfiddle.net/cpv4betn/
Related
I am currently working with Google Forms and want to rearrange the way the responses are being displayed on the "Response Sheet". The only way I can think of doing this is by importing or moving the data to another sheet that would select and transpose certain columns if Column A contains key value.
This is what I'm seeing as part of the input and would like to see as the output if Column A Contains certain text:
Input & Output
Thank you in advance for your help!
O.K.
I rewrite headings a2:e2,
I take whole first five columns without headings e3:e6
I display content of columns A,B,F,G,H for all the rows that have 'A1' in column 1
I take tables built in point 1 and 2 together and sort them by first column
My solution is here:
https://docs.google.com/spreadsheets/d/1n7Ppd8v75mb3qrnJz_Jh_b4HNaj4i56X9wRGnz0l6i8/copy
={A2:E2;
sort({A3:E6;
query(A3:H6,"select A,B,F,G,H where A ='A1'",0)})
}
Could not figure out a way to append data at the end of specific column in google sheets through v4 APIs.
I know we can append a completely new row using Append API: https://developers.google.com/sheets/api/samples/writing#append_values
But this adds a completely new row starting from 1st column. I need to push/append data starting from specific column only.
Like following is the sheet I am working on:
Now I need to add multiple categories like "Ca1" and "Cat2" to the Categories column. I know I can pass data for not to be filled/edited columns as null like:
"majorDimension": "ROWS",
"values": [
[null,"Cat1",null]
[null,"Cat2",null]
]
But after this, if next time I need to append data to Tags column (say Tag1, Tag2) only using the same format, the resulting sheet would become:
"majorDimension": "ROWS",
"values": [
[null,null,"Tag1"]
[null,null,"Tag2"]
]
And hence empty spaces in between like C6 cell will increase if there is no solution, once data becomes huge. I need to maintain the data like this only (column-wise only).
Is there any solution to append data at the end of a specific column?
You can determine the next empty cell using the existing values and then define your range from there.
Get the column values
GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/C:C
Response is a ValueRange, which includes an array of values. Thankfully, "empty trailing rows and columns will not be included", so you can use that to your advantage.
var lastRow = ValueRange.values.length;
Specify your new range selecting only the next empty cell in column C
var range = 'Sheet1!C' + (lastRow+1);
Send your update request
Sheets.Spreadsheets.Values.update(
{
'majorDimension': 'COLUMNS',
'values': [['Tag1']]
},
spreadsheetId,
range,
{ valueInputOption: 'USER_ENTERED' }
);
Assuming that:
sheet is a sheet object (e.g. SpreadsheetApp.getActive().getSheetByName("Sheet1");),
column C (3) is the column you want to paste the data in,
Column C does not have empty cells between C1 and the last C value with content.
data has the following format:
data = [
["Tag1"]
["Tag2"],
...
]
then you can use this generic expression:
const cSize=sheet.getRange('C:C').getValues().filter(String).length;
sheet.getRange(cSize+1,3,data.length,1).setValues(data);
where getRange(row, column, numRows, numColumns).
I'm having a problem getting Google Sheets to color the top 10 values in multiple columns.
I have columns that contain the following stock information:
Account,Ticker,Symbol,YTD,1 Yr,5 Yr,10 Yr,Risk,Return,Star Rating
Example:
T. Rowe Price U.S. Large-Cap Core Fund,TRULX,2.2,3.93,12.3,12.67,2,5,5
I would like to color the top 10 values for the 1 Yr, 5 Yr, 10 Yr columns.
I thought the function large(L:L,10) would do the job but it seems that the function needs to be sorted by the field that its coloring and it doesn't seem to work if the values in the column are formulas. All the data in these fields but the ticker are formulas.
Assume that data column is column A.
Here's step by step solution:
select your range, like: A2:A500
go menu Format → Conditional formatting...
Choose 'Format cells if...' = Custom formula is
Paste this formula: =$A2>=large($A$2:$A,10)
To check if the formula works right, you may use this formula, paste it into empty column:
=QUERY(sort(A2:A,1,0),"limit 10")
This formula will give you the list of top 10 values from column A. Change A to your column.
I am using the sum aggregate to calculate some totals in an angular ui-grid.
The totals get displayed just fine but I could not figure out how to change the label that gets preceeds to the total.
if the total is 5000 for example, the footer will display : total : 5000
How do I remove the word total ? I see it in the source but I cannot figure out how to change it without changing the source.
Thanks
I found the 'undocumented' (http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions.columnDef) property that can be used for this purpose : aggregationLabel
you can remove that just bu adding this function
$scope.hideAgregationChar = function( aggregation ){
aggregation.rendered = aggregation.value;
};
and in your grid definition add this
customTreeAggregationFinalizerFn: $scope.hideAgregationChar,
or if you wan to change the word to another one just change the cell templates like this
cellTemplate: '<div class="ui-grid-cell-contents">\'Total\' (capital \'T\') {{col.getAggregationValue() | number:2 }}</div>'
that will change the total to Total for example.
You have to include just footerCellTemplate as below for that particular column which you need to aggregate sum.
footerCellTemplate: '<div class="ui-grid-cell-contents">\Total:\ {{col.getAggregationValue() | number:2 }}</div>'
for example, the above line will change the total to Total.
I am trying to figure out how to query values from Sheet2 into Sheet1 where column A in Sheet1 matches column A (strings) in Sheet2, and return only the max value of column D (integer) from Sheet2.
Here's what I am using:
=Query(Sheet2!A:F,CONCATENATE("Select D where Name =",A2))
I have tried using Select max(d)... and =MAX(Query(...)) but neither worked for me.
What would be the correct way to do this?
Example data:
Sheet1
Name ColB Date Check Oldest
Bob Y 2/14/2013 4/14/2013 5
Sheet2
Name Title Date Age
Bob Foo 2/1/2013 3
Boo Bar 2/4/2013 5
This may serve, if entered in the cell presently containing Oldest (which would then be overwritten with max Age:
=query(Sheet2!A:D,"select max(D) where A ='Bob' ")
but the result for your sample would be 3 rather than the 5 as shown to be required.