May 10, 2017 08:45 AM
I have multiple needs for a foreach function that would execute on each element of an array. (Side note, there’s nothing that seems to properly count the number of elements in the array.)
The main example is a Date Field on one table being rolled up into a list of dates on another table. All formatting is removed. The only options in the rollup are array functions after the dates are already joined into the “values” variable in the field. Then the result is not a date and cannot be formatted. If we could do a foreach, there would be a tremendous amount of power available and I could address this situation easily by saying “Do X on each element of the rollup values, then join them together in this format.”
Jun 27, 2017 09:09 AM
I’d like this too. I want to perform a simple multiplication on each element within an array.
Have you found any workarounds, Andy?
Jun 27, 2017 01:54 PM
Nope. Haven’t found any solutions yet. A cross-product like you are looking for would be useful as well.
Oct 14, 2020 08:16 AM
HI
IS there a simple solution for this problem ,after 3 years?
Oct 14, 2020 08:16 AM
HI Andy
Maybe you found out how to do thay?
Oct 14, 2020 08:36 AM
The workaround is to perform the operation in a formula field in the original table, then roll up that formula field.
For example, say you want to add 5 to each value on the array before finding the average in a rollup. In the original, table, create a formula field that adds 5 to the original value. Then roll up this new formula field.
Oct 14, 2020 08:48 AM
Allright
Thank you!!
I complicated a simple issue…
בתאריך יום ד׳, 14 באוק׳ 2020, 18:46, מאת kuovonne via Airtable Community Forum <airtable@discoursemail.com>:
Oct 14, 2020 12:15 PM
Hi Kuvonne
Thank so much for trying to help.
At the beginning I thought your idea would work but unfortunately it doesn’t.
Here is a problem.
I must multiply each record with a parameter ( not a constant) . The parameter is different for each row.
For the first record it is X, for the second record it is Y,
At the original table , where I took the values, this parameters doesn’t exist. they are not relevant there. so I can’t prepare the data as suggested.
There must be a way to multiply each item in this record array.
Thanks
Ariel
|
Oct 14, 2020 12:27 PM
Can you share a little more about your use case?
For example, are there always two values in the array? Could you instead use two conditional lookup fields that each return a single value, then multiply the values by their parameters before doing your final calculations?
Can you pass the multiplier back to the original record as a lookup field and do the multiplication in the original field?