Forum Discussion
Select single value in nested table for a new column
I have a nested table that I expanded using the table.expandtablecolumn. One of the columns that I expanded also has a nested table of its own that can have multiple rows.
This nested table with multiple rows has a column called is_latest_user_for_fct which only has one row with "TRUE".
For that one row with "TRUE" under the column is_latest_user_for_fct I would like to extract the value under "last_seen"
How would I go about this?
Hi psmalley-ati
Assume your data is like below, the nested table column is called "Values".
You can add a custom column with below code
Table.SelectRows([Values], each [is_last_user_for_fct] = true)[last_seen]{0}Result:
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
2 Replies
- jbwtpMemorable Member
Hi psmalley-ati,
You can, of course, use filter and fetch the data from the second nested table (for example, using Table.AddColumn to fetch the value). This may look cooler, however, almost certainly, the code will be quicker if you just expand the nested table (with is_latest_user_for_fct and last_seen columns) and then filter the output table for the desired result.
Cheers,
John
- v-jingzhangCommunity Support
Hi psmalley-ati
Assume your data is like below, the nested table column is called "Values".
You can add a custom column with below code
Table.SelectRows([Values], each [is_last_user_for_fct] = true)[last_seen]{0}Result:
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.