I need your help in an SQL query in Google Sheets
I need a query to Select columns that have for example A1 in their name
My problem is that i have more than 150 columns that contain A1 in their title so a query like
query(range,"select D E F where .....") is not helpful as i need to write by hand more than 150 columns!!
So i need a query that either selects columns with certain string in their name or a sggestion to add a specific range in select claus
Here is an example image
and the link of my sample form https://docs.google.com/spreadsheets/d/1pYr1Rx0VasXjmAQC0qa9zNC_3rAdg_dxUKLy42zFTCY/edit?usp=sharing
Thanks in advance
try:
=TRANSPOSE(QUERY(TRANSPOSE(B3:M15), "where Col1 matches 'date|name|^A1.+'"))
Related
I would like for a Google Sheets Query to choose which columns to select based on a cell reference. "select X" for example where the column header equals a cell that I reference. This is different from selecting which rows of a column to display. I want the Colx to be based on a cell reference.
Specifically, the data has different column headers with dates. I want the query to select the column that matches a particular date or any of the headers I may have in a drop down menu.
I used this format but it did not work
=query('Schedules'!A:N,"select A,B,C,D,E,K,H,J,L,M, '"&A2&"' WHERE N=1 and K !='HR(PD)' ORDER BY B,K",1)
This is the cell reference to the column I am looking for: '"&A2&"'
in A2 I have the letter of the column I want to use
Your current formula maybe a bit spotty with the quotes placement. You can see a working sample here:
=query(A:D,"Select A,"&F1&" Where A is not null")
based on header match
=query({A:D},"Select Col1, Col"&xmatch(F1,A1:D1)&" Where Col1 is not null")
I am trying to get the index of the cell value in an excel sheet using Uipath.
I have tried using Lookup range inside Excel application scope but its giving up the first similar value found in the Sheet as having duplicate values as well.
Please Suggest how we can find the the exact index Of the cell.
I have used
LookUp Range activity
Read Cell Formula
Col1 Col2 Col3
DB AB BB
AC DB AN
AK AB AC
I need to find the IndexOf value DB , located at Col2 2nd row
I would use a For-Each item in DB activity.
You can iterate through the lines and access the value with item(0).toString e.g⠀
Then you can go on and check up the location of your searched text.
If you run a counter with it, you can easy detecting the Row and Col number of your searched field.
If you want to lookup in column B alone then you can set range as "B:B" in the Lookup Range Activity.
It will search the value in Column B and give you the index found in the 2nd column.
enter image description here
1.Read the Excel it will stored in DAtatable DT
2.Use for each row in datatable
3.Use if condition inside the loop
currentrow(1).tostring. Contains(“DB”)
4.Take Assign activity
Var_Index(int Datatype) = DT.Rows.indexof(currentrow)
Its may be work….
I've been browsing and to no avail, I can't find any information on how to select/show only the column header. My objective is to select only column header . I've uploaded a picture for better illustration on my objective. In the picture shown, I'm trying to only select and display the one ive highlighted in the red box.
Oracle table:
The only information I found from the net is selecting an individual column, and with that. It will display the data as well which is not my objective. my main objective is to only select column headings.
In Oracle APEX SQL Workshop you can describe a table with this command:
desc table_name
If you're using a query, you can click on the "Describe" tab below the query and above the result grid.
I had a similar requirement, so in page designer I plugged in a "Where Clause = Sysdate-1"
you can use select and null to pick columns and use alias to name them
select null AS column_name,null AS column_name
from TABLE_NAME
I will try to put forward this question in a simple way. Consider that I have a table with two columns (Name, Contact_No). We can have the same name but with different Contact No in the table. All I want to know is to find out which name is NOT repeated in the entire table. Or in other words, which name is unique in this table and has appeared only once.. This is just an example, the actual scenario is quite different but if anyone can help me with this example, I'll be able to handle the actual scenario.
Here is an example
Name Contact_No
A 123
A 124
B 125
C 126
C 127
All I want is to find (B) which is not repeated in the entire table. Thanks
You can simply do this:
SELECT name FROM tbl_name GROUP BY name HAVING COUNT(name) = 1
Check Out SQLFIDDLE
I am trying to create a table with two groups in a BIRT report.
I first group by year, and then by a criteria in a second column. Let's say this criteria is one of [A, B, C, D]. If there doesn't exist a criteria for a year, the default in BIRT is for it to be blank. For example, if 2011 didn't have any B or D criteria, my report would look like:
2010
----
A 1
B 2
C 3
D 4
2011
----
A 5
C 6
However, I want all the possible criteria to show up, even if they don't have any entries for a particular year.
I tried setting the property under advanced->section->show if blank = true, but that didn't do anything.
Any ideas?
(I am using birt 2.6.0)
The SQL query (connecting to a mysql datasource) is fairly simple:
SELECT year_field, decision_field, sales_field
FROM databaseName
The report is http://bit.ly/9SDbNI
And produces a report like:
As I commented earlier, this is a dataset issue, not a BIRT issue. The issue is that the dataset does not include rows where there were no sales for those decision codes, in those years.
I was rather hoping there would be separate tables for the years and decision codes, but it looks as though there's a single table for everything. Therefore, I suggest the following query (based on the query in the rptdesign file, rather than the question):
select y.year_field, d.decision_field, t.sales_field
from
(select distinct year_field from databaseTable) y
cross join (select distinct decision_field from databaseTable) d
left join databaseTable t
on y.year_field = t.year_field and d.decision_field = t.decision_field
Also, change the definition of the Count column to be a count of the sales field, rather than the decision field.
I noticed that you are using MySql. Use SELECT IFNULL(<MyCol>,0) from my_table; to replace the null values with 0.