Jmp 14 - count specific occurrence prior another specific value in a columnhey guys
i have a column with 2 different strings, A and B.
i need to count the occurance of A, before every occurance of B. so i can get a column that representes for every row conatining B, how many rows of A were presented before.
atached example table, with manual calculation of the desired column.
appreciate a lot any help.
Re: Jmp 14 - count specific occurrence prior another specific value in a columnHere is one possible way to write the formula. The attached data table has the formula applied
If( Row() == 1,
counter = 0;
result = .;
);
If(
:Type == "A",
counter++;
result = .;,
:Type == "B",
result = counter;
counter = 0;
);
result;