AppInventor - Three values in one row list - app-inventor

I would like to insert into my TinyDB values like: current_address, current_latitude, current_longitude
I've created something like this:
https://gyazo.com/4a63791c17182838841d5b6e78b6359b
But it shows values like:
Current address
in next row latitude
in next row longitude
I would like to have everything in one row like:
address. latitude, longitude

Use a join block and instead of putting it on a list view, put it in a label:

Related

How to split a Webix datatable column into multiple columns?

In my webix datatable, I am showing multiple values in the cells for some columns.
To identify which values belong to which header, I have separated the column headers by a '|' (pipe) and similarly the values under them as well.
Now, in place of delimiting the columns by '|' , I need to split the columns into some editable columns with the same name.
Please refer to this snippet : https://webix.com/snippet/8ce1148e
In this above snippet, for example the Scores column will be split into two more editable columns as Rank and Vote. Similarly for Place column into Type and Name.
How the values of the first array elements is shown under each of them will remain as is.
How can this be done ?
Thanks
While creating the column configuration for webix, you can provide array to the header field for the first column along with the colspan like below:
var columns = [];
columns[0] =
{"id":"From", "header":[{"text":"Date","colspan":2},{"text":"From"}]};
columns[1] =
{"id":"To","header":[null, {"text":"To"}]};
column[0] will create Date and From and column[1] will be creating the To.

PowerBi DAX equivalent for SUMIFS with current row value as filter

In Excel I could, if I was in a table called 'Sales' that had four columns
Sales
Month, CustomerId, ProductId, TotalQuantity
Jan,1, CAR,
Feb,1, CAR,
I could add a formula:
=SUMIFS(Sales[Quantity],Sales[CustomerId],[#[CustomerId]])
That would go to the Sales table and sum the CustomerID column filtered by the CustomerID of the current row where the formula has been entered.
I am attempted to replicate this in a PowerBI Calculated Row but I can't get the # working for a row reference. It comes across like
TotalQuantity = CALCULATE(SUM(Sales[Quantity]),Sales[CustomerId] = Sales[CustomerId]))
Any idea how to get the equivalent # working?
I think the key function you are missing is EARLIER. That is not surprising because it has a misleading name - it really means "Current Row". You also need a FILTER function in the Filter parameter of CALCULATE, to reset the filter context to the entire table.
So your New Column function might look like this:
TotalQuantity = CALCULATE(SUM(Sales[Quantity]), FILTER(Sales, Sales[CustomerId] = EARLIER (Sales[CustomerId])))
Here's a neat example, from the most accessible source site for DAX formulas:
http://www.powerpivotpro.com/2013/07/writing-a-subtotal-calc-column-aka-the-simplest-use-of-the-earlier-function/
And FWIW here is the official doco on EARLIER:
https://msdn.microsoft.com/en-us/library/ee634551.aspx

Using XPath to find rows where a specific column has value

I'm having trouble using XPath to find a row in a table where a specific column contains a value. The table has 10 columns where 2 of them will show Yes|No but I'm only interested in finding the value in one of the columns (the 4th one). My initial attempt was this:
//table[#id='myTable']/tbody/tr/td[text() = 'Yes']
but it finds it rows from both columns. I thought I could try something like this but it's not a valid expression:
//table[#id='myTable']/tbody/tr/td[4]/text()='Yes'
Any suggestions? Thanks.
You can try this way :
//table[#id='myTable']/tbody/tr[td[4][. = 'Yes']]
The XPath return row (tr) having the forth td child value equals "Yes".

Explode function returning single row

I used the field type as Array. "Select col as sample_table" returns the below output.
["[-80.86598534884,35.53423185253291],[-80.86598789514547,35.53423048990488],[-80.86598794307857,35.53423046392442]"]
When I used
select explode(col)
from sample_table.
I get the output as below which is a single row.
[-80.86598534884,35.53423185253291],[-80.86598789514547,35.53423048990488],[-80.86598794307857,35.53423046392442]
I want the output in 3 rows as below.
[-80.86598534884655,35.53423185253291]
[-80.86598789514547,35.53423048990488]
[-80.86598794307857,35.53423046392442]
As i see in the hive tutorial, explode function should return multiple rows but i don't see it happening
The input you have given appears as an array field having only one value. That entire value is taken as array of size one by explode function and thereby returns the result in a single row.

Using XPATH to select the row *after* a row containing certain text

I can't work out if this is possible or not, I've got a basic table but that table has a varying number of rows and data within it.
Assuming the table is just one column wide and a random number of rows long to select a row containing the text "COW" I can do something very simple like do: -
table/tbody/tr[contains(td[1],"COW")]/td[1]
But lets say that this table contains two types of data in it, a list of animals and, underneath each animal, a list of attributes, all in the same column, looking something like this: -
COW
Horns = 2
Hooves = 4
Tail = 1
CHICKEN
Horns = 0
Hooves = 0
Tail = 1
Is there a way using XPATH to first identify the row that contains the text COW and then select the row directly after this to return the text "Horns = 2"?
Cheers
It seems that you want something like this:
table/tbody/tr[contains(td[1],"COW")]/following-sibling::tr[1]/td[1]
This will select the first td in the row immediately following the row which contains the td which contains COW.

Resources