Take value from data in bigquery - google-bigquery

Hi I want to take value cuisine from table a in column a with value - ak://food/category?pageTitle=Minuman&cuisine=MINUMAN&sortBy=1. The result I want is MINUMAN. How to take value cuisine?

Use below as an example
select regexp_extract('ak://food/category?pageTitle=Minuman&cuisine=MINUMAN&sortBy=1', r'\bcuisine=(\w+)\b')
with output

Related

how to get the data from a column based on name not the index number

I have a dataframe with column abc having values like below
[{note=Part 3 of 4; Total = $11,000, cost=2750, startDate=2021-11-01T05:00:00Z+0000}]
Now I want to extract data based on name,for example i want to extract cost and start date and create a new column.
Asking it to be working on name because the order of these values might change.
I have tried below line of code but due to change in the data order I am getting wrong data.
df_mod = df_mod.withColumn('cost', split(df_mod['costs'], ',').getItem(1)) \
.withColumn('costStartdate', split(df_mod['costs'], ',').getItem(2))
That's because your data is not comma-separated, it just looks like that. You'll want to use regexp_extract to find the correct content.

only get numberic value in qlikview

i have this kind of data
-
B-3-I11
B-3-I12
BI1-I190
BI1-I191
BI1-I192L
BI1-I194A
BI1-I195L
BI1-I198R
BI1-I199L
BI1-I200Ac
BI1-I201L
conasde
Installation
Madqw
Medsfg
Woasd
this is the data I have .. now I want only those which start from B and have some numeric character in data..how I get in qlikview script
how to extract only those data ..
To filter to those that start with B you'd do
where left(Field,1)=B
Then to filter on those with numbers, you could add
and len(keepchar(Field,'1234567890'))>0
So that would give something like this:
LOAD Field
From Table
Where left(Field,1)=B
AND len(keepchar(Field,'1234567890'))>0
(where Field is the name of the field your data is in and Table is the name of the table your data is in)
Or, if you want to keep all the data but create a new field you would do:
LOAD
Field,
if(left(Field,1)=B AND len(keepchar(Field,'1234567890'))>0`,Field) as FieldFiltered
From Table

SSRS - How to get column value by column name

I have one table with rows and each row has a column that contains a field name (say raw1 - 'Number001', raw2-'ShortChar003', etc). In order for me to get that value of these fields I have to use a second table; this table has 1 raw with many columns (number001, Number002, ShortChar003, etc).
How can I extract the value?
Good Question..You can use lookup function
=Lookup(Fields!CityColumn.Value, Fields!CityColumn.Value, Fields!CountColumn.Value, "Dataset1")
Or you might have to use string functions..ex LEFT, Substring, Right same like SQL.If possible pls post some data of both tables, I will explain in detail

Talend - Count row on tOracleInput

May I ask how to count the row of tOracleInput and place it to the tOracleOutput. At the same time, can I add the values of that column SUM(tOracleOutput.OS_BALANCE)?
You could use the tAggregateRow component like this:
You should leave group by paramaters empty and create an output schema that will hold the sum and count. The row generated will then be fed to tOracleOutput.

How to store the result of a query in an existing column using PostgreSql

I have the following table
user
**id, name**, timestamp, place, time
the id with the name form the PK
I want to store the result of the following query in the time column which is already exist but contain no data
SELECT "time"(timestamp) FROM user as time
so if I had for example the following data
id: 1, name: Ann, timestamp: "2002-08-30 08:24:00", Place:US time:
and if if result of the following query
SELECT "time"(timestamp) FROM user
is 08:24:00
I would like to store that in the time column and I want to do that for all the users in the table
I tried the following
SELECT "time"(timestamp) FROM user as time
but it only displays the result as an output and I would like it to be stored
is there a way to do that ?
thanks
If you just want to set the "time" of each row to the time-of-day of its "timestamp" then:
update "user" set time = timestamp::time;