Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ptl14624
Contributor III

KPI - Sucessive Victories

Hi.

 

I Want to create a KPI which could count the greatest winning streak (for example: 6 victories).

For that i have the field Game Number (1, 2, 3, 4... 189) , and the Result (Victory or Deafeat).

 

Any ideas?

Thanks 

Labels (1)
1 Reply
JordyWegman
Partner - Master

Hi,

A streak means here, the amount of consecutive wins rights?
Try this in the script. It's about the IF function.

Table:
Load
	*,
    IF(Score = 'Win' and Previous(Score) = Score, peek(_cntWins) +1,1) as _cntWins;
Load * Inline [
Game, Score
1, Win
2, Loss
3, Win
4, Win
5, Win
6, Win
7, Loss
8, Loss
9, Loss
10, Win
11, Win
12, Win

];

 

Put in the KPI object: 

Max(_cntWins)

 

Jordy

Climber

Work smarter, not harder