Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Select one row from each group for a slice

Hi,

I’m writing an expression for a slice and am trying to filter the survey table data to:

  • just one row (any)
  • from each group of [survey_number] rows
  • where the [branch_A_asset_list] row is not blank.

This is as far as I’ve got… but it’s not doing the job…

[_RowNumber] =
MAX(
SELECT(
        survey[_RowNumber],
AND(
		[survey_number] = [_THISROW].[survey_number],
        [lcs] = [_THISROW].[lcs],
		[select_cabinet_to_survey] = [_THISROW].[select_cabinet_to_survey],
		[select_asset_type] = [_THISROW].[select_asset_type],
        ISNOTBLANK([branch_A_asset_list])
		)))

.
.
From this example I’m trying to end up with just three rows - one from each highlighted area?

survey table

Thanks in advance…

Solved Solved
0 5 1,293
1 ACCEPTED SOLUTION

Hey @Austin_Lambeth,

I found it… This one returns one row from each group of rows…

[_RowNumber] = 
MAX(
SELECT(
  	survey[_RowNumber],
	AND(
	[lcs] = [_THISROW].[lcs],
  	[select_cabinet_to_survey] = [_THISROW].[select_cabinet_to_survey],
  	[select_asset_type] = [_THISROW].[select_asset_type],
  	[survey_number] = [_THISROW].[survey_number],
  	ISNOTBLANK([branch_A_asset_list])
    )))

View solution in original post

5 REPLIES 5
Top Labels in this Space