BigQuery position function for element within a nested element - google-bigquery

How do I get the position for a field nested in multiple level of records:
select position(repeatedRec.rec1.field)
where repeatedRec is a repeated record, and rec1 is a non-repeated record? Assume that repeatedRec doesn't have any other leaves. I need to know what is repeatedRec position for the element in which rec1.field resides.
This doesn't seem to work, and all I get is 1 (as if the system is treating the field as a non repeated field).

have you tried
select position(repeatedRec.rec1.field) WHITHIN repeatedRec.rec1 as f1
https://developers.google.com/bigquery/docs/data#within
see this link for a small documentation on within

Related

SQL expression for when .... then ....does not work properly

I am kind of new to qgis and this forum but I have a problem for which i would like some help. I made a raster layer indicating different landcovers based on an image. I now want to assign the most frequently found landcover within a polygon to be assigned to that polygon. I intended to do this by counting the landcover pixels within the polygons and then making a new field in the attribute table from to polygon to assign the highest count of pixels to the field. i intended to do this using a when ... then ... expression. However, this is not going right, it first of all does not assign a value to all the records, so some get a 'null' value. Also in some situation it actually does not assign the highest count to the new field.
raster and polygon field
Expression part 1
Expression part 2
Result from the expression in attribute table
As can be seen in this figure, landuse3 has 'null' values and the highlighted record is also incorrect, the result should be 'road' instead of 'flat roof'.
It would be really nice if someone could help me out with this :)

what is the corresponding field name of event_dim according to new BigQuery export schema?

Link to schema
I am trying to find event_dim records according to new schema.Could not find it.
The last line of the migration script on the same webpage says "UNNEST(event_dim) AS event". And UNNEST is described in the BigQuery documentation as:
The UNNEST operator takes an ARRAY and returns a table, with one row for each element in the ARRAY.
In other words: every row represents an event now, in stead of one row containig a RECORD with multiple events.
Also the fields of event_dim are mapped to slightly different names, as you can see in the first SELECT at the beginning of the script:
event_dim.timestamp_micros is mapped to event_timestamp
event_dim.previous_timestamp_micros is mapped to event_previous_timestamp
event_dim.name is mapped to event_name
etc...
In conclusion: the main difference is that one row contains exactly one event in the new schema. Next to that, the fields are renamed.

Where can I find the current value of a position in the Avaloq Banking Suite tables?

I'm looking for the table that shows the value of a position on a specific day, or at the very least, just the current value of the position without having to search through the doc_meta_type tables.
pos_serpil is the table you are looking for, it contains the values of the positions updated twice a day. It is also historical, so if you search using timestamp, you can return the value of the position for a specific date.
If you want at the very least, just the current value of the position. This shortcut query will do the work.
select script#.eval_expr('obj_pos(x).qty') from dual;
Where x is the position id. Make sure that the session is open before running the query. (exec session#.open_session;)

SSRS: In a chart group by combining two datasets

I have a report that in the values I have 2 data sets, and then grouping by a location to display the data. If I use the one location within 1 dataset then sure one of the averages I am displaying is perfect but the other is incorrect showing the same result across the board.
No down I need to join these together to get an outcome.
here is what I have:
Values:
1. =Avg(Fields!Rating.Value)
2. =((sum(Fields!Low_rating.Value,"MIN_MAX_CCR") + sum(Fields!Max_rating.Value, "MIN_MAX_CCR")) / 2 ) / Count(Fields!Case_ID.Value, "MIN_MAX_CCR")
Category Grouping:
1.=lookup(Fields!CaseID.Value,Fields!Case_ID.Value, Fields!location.Value,"MIN_MAX_CCR")
So the first field is from the current dataset, the second is from the MIN_MAX_CCR dataset, the location is from the first data set, and then getting the data set for the case_ID.
Now when I run this I get this lovely error:
System.Web.Services.Protocols.SoapException: The Group expression for the grouping ‘Chart8_CategoryGroup’ refers to the field ‘location’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.
at
I just cant see a way around this - I cant combine the data in one query due to the nature of the query differences.
You are trying to return location from MIN_MAX_CCR, but it doesnt exist.
I would read the documentation or intellisense hints on the Lookup function to learn how to write it correctly.

How to loop <TR> rows within Table in WebBrowserControl?

I have a web page that I am trying to pull data elements from. I am trying to figure out how to loop the tags in the web page, contained within the specific "TABLE" tags shown.
Dim ProductionRpt = WebBrowser1.Document.GetElementById("ProductionReport").Children
For Each row As HtmlElement In ProductionRpt
MsgBox(row.InnerText)
Next row
The above code is what I am trying to do with the table rows, only the code above returns the innertext for the table html element, and not any of the tags contained within the table. Perhaps this is expected if you are only looking at the table element itself (which is indeed what I told it to do) and not any of the rows. How do I loop through all the tags so I can get access to the data I want? Is there another way besides using .GetElementsByTagName?
It depends on what you're expecting to find inside those rows... If you're sure to find 0 or 1 level of <a> tags you should simple create additional If statements and Loop to check using GetElementsByTagName like you said. Even if you had more tags to check for you could iterate through a list of "expected tags".
If you don't know how many nested elements inside each row you're going to find then you should probably create a recursive function and look for any child element (and its value) inside a row before continuing to the next one.
http://msdn.microsoft.com/en-us/library/81tad23s.aspx