Added a VC of type Decimal. Trying to write an expression with 6 values. Nothing is working. Reduced the expression to display one of the numbers. It comes out as Zero every time.
Date Types:
INTEGER: Wind[Speed]
DECIMAL: Drift[Factor]
Also tried:
Drift[Factor]*1.0
DECIMAL(Drift[Factor])
Drift[Factor] (errors stating the return value is of type list)
Decimal(Wind[Speed] * Drift[Factor])
Decimal(Wind[Speed]) * Drift[Factor]
Wind[Speed] * Drift[Factor]
Confused why this is so difficult. This seems like one of the most basic things one might want to do… What am I missing?
I’ll take a run at this… I think what Marc is saying is that you are referencing a list in your expressions where you probably mean to reference a value. Assuming you have a table called Wind and a column called Speed then whenever you say Wind[Speed], appsheet returns a list of all the values appearing in that column across all rows. When you reference [Speed] without the table name, you get the value of [Speed] for this row.
Is there another possibility than making a circular reference for something I’ve admitted isn’t clear? See dozens of folks asking the same type question, with confusing threads.
Is there an existing example I could look at which shows how to utilize numbers from different tables in an expression of type decimal?
If I understand what you’re saying… Whenever an expression uses anything from another table, even if one specific value it will still be of type list? Seems odd… But ok.
Is there an existing example I could look at which shows how to utilize numbers from different tables in an expression of type decimal?
I think you misunderstand.
tableName[columnName] returns a list.
[columnName] by itself returns the cell value for that column in [_THISROW].
if you want a to return a single value from a row other than this row, try lookup(), which will return the value any specified cell.
This appears to work. Is there any advantage/disadvantage to use MAX vs Lookup?
max(Drift[Factor]) * max(Wind[Speed])
As you pointed out, referencing cells from other tables are returns datatype LIST. A list of one item needs to be converted to a number or decimal in order to work with it mathematically. Wrapping the returned LIST with a function to extract the value inside allows this to work.
You’re welcome, but to clarify, it’s not whether or not the table is the current table or a different table that delineates whether or not the return is is a list or a value. It’s whether or not the statement includes the table name. So, even for the current table, tableName[columnName] would return a list.