4 Replies Latest reply: Jun 19, 2017 5:56 AM by Martijn Noorda RSS

    Count function in graph

    Martijn Noorda

      I used an expression in a graph as follows:



      Count({<[Tijdigheid]={'Op tijd'}>} DISTINCT [Transaction No.]) /count([Transaction No.])


      It counts transactions that were booked on time and divides them by the total transactions to derive a percentage. I used portfolio as a dimension.


      It seemed to be working fine, but when I selected 'Te laat' (Too late) from the Field 'Tijdigheid' (timeliness), the percentages of timely booked transactions spike. I would expect that when only 'Too late' Transactions are selected, the percentage of timely booked transactions would be zero, since only 'Too late' booked transactions are selected. However, the function count([Transaction No.], counts only those transactions that are selected (the transactions that are too late), where as Count({<[Tijdigheid]={'Op tijd'}>} DISTINCT [Transaction No.]), counts all timely booked transactions within the portfolio, no matter the selection in the field 'Tijdigheid'.

      This is not necessarily a problem, since the main objective of this graph is to present the percentage of timely booked transactions. However, I am looking for an explanation, because I fail to understand why the part of the function in the numerator of my function does not change based on the selection, where as the result of the function in the denominator does change. Can anyone please explain this to me?

      Thanks in advance!