How to stop upper() from being pulled through as part of Google Sheets QUERY? - select

I'm unable to find a way of making sure that upper() is not pulled through when using the QUERY function on Google, specifically with SELECT.
I have an example below:
=QUERY(countries, "SELECT UPPER(C)", 1)
But this outputs upper() as one of the cells. In this case the first item of the column is Continent so this pulls through as "upper(Continent)
Example Spreadsheet here
Does anyone know how to fix this so that upper() doesn't appear at all?

try:
=QUERY(QUERY(countries, "select upper(C)"), "offset 1", 0)
=QUERY(QUERY(countries, "select upper(C),upper(B)"), "offset 1", 0)
tho all you need is:
=ARRAYFORMULA(UPPER({C2:C, B2:B}))
or shorter:
=INDEX(UPPER({C2:C, B2:B}))

Found the answer here!
Basically you need to label the column as nothing like so:
=QUERY(countries, "SELECT UPPER(C) label UPPER(C) ''", 1)
Hope this helps someone at some point as it took me a while to find!

Related

Select Data using date between operator and two unconnected tables

I am tryin to resolve this situation. The following piece of code works ok .
SELECT FISCAL_START, DESCRIPTION,
CASE WHEN FISCAL_START BETWEEN DATE'2014-03-31' AND DATE'2014-09-29' THEN DESCRIPTION
ELSE 'Test Failed'
END
FROM GL_PERIOD
what I am trying to achieve is as follows instead of the hard coded dates of 2014-03-31 and 2014-09-29..need to replace those with column names FISCAL_START and FISCAL_END dates from an unconnected view call WORK.
Psuedo code is as follow s...
Show Description from GL_PERIOD where ENTER_DATE (which is in WORK view) is between FISCAL_START and FISCAL_END. Any help will be greatly appreciated.
I think you need this, I just continue your query to add the missing piece:
Here is sqlfiddle that will show you live example: fiddle example
SELECT "FisStart", "Descripton",
CASE WHEN "Entry_Date"
BETWEEN "FisStart"
AND "FisEnd"
THEN "Descripton"
ELSE 'Test Failed'
END
FROM GL_PERIOD
INNER JOIN WORK USING USING ("SrNo")

Issues with "QUERY(IMPORTRANGE)"

Here's my first question on this forum, though I've read through a lot of good answers here.
Can anyone tell me what I'm doing wrong with my attempt to do a query import from one sheet to a column in another?
Here's the formula I've tried, but all my adjustments still get me a parsing error.
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1yGPdI0eBRNltMQ3Wr8E2cw-wNlysZd-XY3mtAnEyLLY/edit#gid=163356401","Master Treatment Log (Responses)!V2:V")"WHERE Col8="'&B2&'")")
Note that importrange is only needed for imports between spreadsheets. If you only import from one sheet into another within the same spreadsheet I would suggest using filter() or query().
Assuming the value in B2 is actually a string (and not a number), you can try
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1yGPdI0eBRNltMQ3Wr8E2cw-wNlysZd-XY3mtAnEyLLY/edit#gid=163356401","Master Treatment Log (Responses)!V2:V"), "WHERE Col8="'&B2&'", 0)
Note the added comma before "WHERE". If you want to import a header row, change 0 to 1.
See if that helps? If not, please share a copy of your spreadsheet (sensitive data erased).

Gremlin: Get list of vertices that do not have certain property fields

I want to find a list of people that are missing at least one of these properties: Title, DisplayName, FirstName,LastName, Id, Email.
I have tried the below but get an error
"java.lang.ArrayIndexOutOfBoundsException"
If I only run the first three lines, I am getting results for people that do not have a DisplayName with empty values for that property, however there is no property column for Title.
g.V().hasLabel('people').hasNot('Title')
.or().hasLabel('people').hasNot('DisplayName')
.or().hasLabel('people').hasNot('FirstName')
.or().hasLabel('people').hasNot('LastName')
.or().hasLabel('people').hasNot('Id')
.or().hasLabel('people').hasNot('Email')
Why do you overcomplicate the query? Who not just this:
g.V().hasLabel('people').not(
has('Title').has('DisplayName').
has('FirstName').has('LastName').
has('Id').has('Email'))
However, it's not really clear to me what your expectation is (the statement "however there is no property column for Title" is kinda confusing), but maybe the rewritten query will already help you (if not, then please provide some sample data and the expected result, that always makes it much easier to answer traversal-related questions).

In selector with asterisk * not working in report selection

What is the proper way to search a table for every record that starts in a similar way? I have tried:
"THESE. WORDS" IN {example_one.job_title} and {example_two.status} = "A"
But I need all combinations, including "THESE. WORDS*" Adding the asterisk doesn't work, I guess because of how IN works.
To summarize information in the comments,
to limit job_title by the list of values in these. words, you need your field on the left hand side and the values on the right.
you may want {example_one.job_title} LIKE 'keyword*'
If you found this information helpful, you can upvote and/or accept the answer.

Crystal Formula to exclude if value does not contain a certain format

I'm trying to exclude any value from a certain field (table.value) that does not match this format AA#####A. Example if they entered APT12345T, or PT12345PT and No Value then I want to exclude it from the report. It needs to match example AP12345P. What selection formula can I use to accomplish this.
Any help is greatly appreciated
Thanks in advance.
try reading Crystal's help topics on the mid() and isnumeric() functions.
here's an example from the help file:
Examples The following example is applicable to both Basic and Crystal
syntax:
Mid("abcdef", 3, 2)
Returns "cd".
so, in your case, you want to strip your value into three pieces,
mid(table.value,1,2)
mid(table.value,3,5)
mid(table.value,8,1)
and build up a three-part boolean variable where:
the first piece is not numeric(), or between 'AA' and 'ZZ', or however
else you want to test for letters,
the second part isnumeric(), and
the third part passes the same test as the first part.
where are you getting stuck?
something like this:
not isnumeric(mid({table.field},1,2)) and
isnumeric(mid({table.field},3,5) and
not isnumeric(mid({table.field},8,1))