Skip to main content

Hi All !

 

I'm having a trouble with creating a table with points. What is causing a problem is the shape of the underlying data:

I have to assign the points by using [FullTimeResult] dimension. So as far now I do have [Points] calculation which is as follows:

 

IF [FullTimeResult]='H' OR [FullTimeResult]='A' THEN 3

ELSEIF [FullTimeResult]='D' THEN 1

ELSE 0 END

 

Next up is Team calc (which does not work because of WHEN 'D' THEN ... AND ...) :

 

CASE [FullTimeResult]

    WHEN 'A' THEN [AwayTeam]

    WHEN 'H' THEN [HomeTeam]

    WHEN 'D' THEN ([AwayTeam] AND [HomeTeam])

END

 

The result is (/w WHEN 'D' THEN ([AwayTeam] AND [HomeTeam]) commented):

I want to assign 1 point to both teams if the match was drawn. Any ideas?

 

Kind regards,

Alex

5 answers
  1. Apr 16, 2019, 12:39 PM

    Hi Aleksander

     

    The Data source isn't structured in a way to answer your question with complete accuracy. I'd want one column that is "TEAM", and another qualifier that is "HOME/AWAY":

     

    Hi Aleksander The Data source isn't structured in a way to answer your question with complete accuracy.

     

    So I am going to pivot those two columns:

     

    pastedImage_1.png

     

    to this:

     

    pastedImage_2.png

     

    and now I can work with it nicely:

     

    pastedImage_3.png

     

    How do I get this? Well, a few things.

     

    All your calculations crashed because there no longer exists a field name HomeTeam and a field named AwayTeam. So I had to make new ones:

     

    pastedImage_4.pngpastedImage_5.png

     

    What's Unique Match?

     

    pastedImage_6.png

    I am assuming that can't be non-unique.

     

    Now all your calculations come back. But you need to make a change to your [!Points] calc:

     

    pastedImage_7.png

    Attached is the whole workbook with all these changes. Hope it helps

0/9000