Find specific [survey_status] for an asset that has many records

Eveningโ€ฆ Please could someone point a newbie in the right direction?

I need to look at [asset_name] and find the most recent [survey_status] in the survey table below which has updates & adds permissions:

2X_4_4f239cb5cbe9ee285509b185c8b6720ff0159f33.png

And then put it in [survey_status] against [rfdesign_source_asset_name] in the rf_design table below which only has updates permissions:

2X_0_0082991a5c8fcc3c7b98aa6d7a49435553c73b8a.png

Thanks in advanceโ€ฆ

Solved Solved
0 15 481
1 ACCEPTED SOLUTION

Bahbus
New Member
LOOKUP(
  MAXROW(โ€œsurveyโ€,โ€œ_ROWNUMBERโ€,
    IN([_THISROW].[rfdesign_source_asset_name], [asset_name])
    ),
  โ€œsurveyโ€,
  โ€œidโ€,
  โ€œsurvey_statusโ€
)

View solution in original post

15 REPLIES 15

You might want to try below in an app_formula of a new Virtual Column of the rf_design table:

LOOKUP(
  MAXROW(โ€œsurveyโ€,โ€œ_ROWNUMBERโ€,
    [asset_name]=[rfdesign_source_asset_name]
    ),
  โ€œsurveyโ€,
  โ€œidโ€,
  โ€œsurvey_statusโ€
)

Small adjustmentโ€ฆinstead of saying
โ€ฆ=[rfdesign_source_asset_name]),
you would need to say
โ€ฆ=[_THISROW].[rfdesign_source_asset_name])

Thanks @Heru & @Aleksi,

Done that but getting the following error:

Either of these two columns are then an EnumList?

Hi @Aleksi โ€ฆ

Correctโ€ฆ [survey_status] in the survey table is Enumโ€ฆ

Enum field is not a list type. Only EnumList is.

Check your [asset_name] and [rfdesign_source_asset_name] columns

Hi @Aleksi,

Is there a way for me to โ€˜flattenโ€™ the [asset_name] EmunList result and refer to just the value presented in that fieldโ€ฆ?

Hi @Aleksi,

Oopsโ€ฆ Youโ€™re rightโ€ฆ [Asset_Name] is EnumList

Hi @Aleksi,

I donโ€™t know if this will helpโ€ฆ This is what [asset_name] Valid If does:

SORT(UNIQUE(

SELECT(RF_Design[RFdesign_SOURCE_Asset_Name],
AND([_THISROW].[Select_Asset_Type]=[RFdesign_SOURCE_Asset_Type], [RFdesign_Main_Asset] = [_THISROW].[Select_Cabinet_To_Survey])) +

  SELECT(RF_Design[RFdesign_DESTINATION_Asset_Name],
  AND([_THISROW].[Select_Asset_Type]=[RFdesign_DESTINATION_Asset_Type], [RFdesign_Main_Asset] = [_THISROW].[Select_Cabinet_To_Survey]))), FALSE)

Bahbus
New Member
LOOKUP(
  MAXROW(โ€œsurveyโ€,โ€œ_ROWNUMBERโ€,
    IN([_THISROW].[rfdesign_source_asset_name], [asset_name])
    ),
  โ€œsurveyโ€,
  โ€œidโ€,
  โ€œsurvey_statusโ€
)

@Bahbus strikes againโ€ฆ That workedโ€ฆ Learning something new every dayโ€ฆ Many thanksโ€ฆ

Thanks also to @Heru for pointing me in the right direction and @Aleksi for weighing inโ€ฆ Cheersโ€ฆ

Hi @Bahbus

Your solution works and shows the expected result when I look at the form i.e. [survey_status] shows โ€œCompletedโ€.

However, Iโ€™m making some kind of rooky error cause I only see the updated [survey_status] in my table if I update the record?

Please advise if it is possible to show updated [survey_status] for all rows without updating the record?

2X_8_81f4ccbb9600e293b7fe7fc839d936f6ad57effe.png

I was expecting to see โ€œCompletedโ€ for CAT037 too and obviously nothing for anything else yet?

For a normal column, you need to open the record and save.

I believed, you will need to update it again later, you might want to consider to use an Action for that.

Top Labels in this Space