Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
i have one field called Ergebnis. in this field there are a lot of summarys.
My goal is it, to show a bar graph with the sum of wins, draws and so on.
But where can I use this code ? Directly in the script or in the bar graph ?
//if (Heimspiel = 'x' and left(Ergebnis,1)> left(Ergebnis,3), 'WIN',if (Heimspiel = 'x' and left(Ergebnis,1)= left(Ergebnis,3),'Draw,'Lose'))
Thanks...
This?
Dimension:
None
Expression:
=Sum(If(SubField(Ergebnis, ':', 1) > SubField(Ergebnis, ':', 2), 1, 0))
=Sum(If(SubField(Ergebnis, ':', 1) < SubField(Ergebnis, ':', 2), 1, 0))
=Sum(If(SubField(Ergebnis, ':', 1) = SubField(Ergebnis, ':', 2), 1, 0))
Hi,
thanks for your answer.
In my datasource there are PlayerIDs and in the second line the results. Can i sum the result with an distinct or something else ?
My diagram should display one win and one draw 🙂
Thanks for helping
Assuming you have an identifier which show that first 4 rows are from one game and the next 4 are from the another game you can do it.
Sample data:
Load * inline [
PlayerID,Ergebnis, Heimspiel, GameID
ID001,0:0,x, 1
ID002,0:0,x, 1
ID003,0:0,x, 1
ID004,0:0,x, 1
ID001,1:0,x, 2
ID002,1:0,x, 2
ID003,1:0,x, 2
ID004,1:0,x, 2
];
Expressions:
=Sum(Aggr(If(SubField(Ergebnis, ':', 1) > SubField(Ergebnis, ':', 2), 1, 0), GameID))
=Sum(Aggr(If(SubField(Ergebnis, ':', 1) < SubField(Ergebnis, ':', 2), 1, 0), GameID))
=Sum(Aggr(If(SubField(Ergebnis, ':', 1) = SubField(Ergebnis, ':', 2), 1, 0), GameID))