cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Choose Language Hide Translation Bar
eldad_galili
Level III

Grouping Data

Hi,

 

I would like to group data as the attached image.

whenever there is a "No" the result will be a 0.

When ever there is a "Yes" the result will be a running number (1,2,3...) for each group.

 

How do I implement this in a formula (or script?).

 

Thank you very much.

 

 

 

Group.JPG

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Grouping Data

Copy this expression and paste it into the Formula Editor for the Grouping column:

 

If(
	Row() == 1,
		temp = :Y == "Yes";
		temp;,
	:Y == "Yes" & Lag( :Y ) == "No",
		temp++;
		temp;,
	:Y == "Yes", temp,
	0
)

 

Change the name of Y to the original data column.

View solution in original post

2 REPLIES 2

Re: Grouping Data

Copy this expression and paste it into the Formula Editor for the Grouping column:

 

If(
	Row() == 1,
		temp = :Y == "Yes";
		temp;,
	:Y == "Yes" & Lag( :Y ) == "No",
		temp++;
		temp;,
	:Y == "Yes", temp,
	0
)

 

Change the name of Y to the original data column.

eldad_galili
Level III

Re: Grouping Data

Thank you very much