6 Replies Latest reply: May 16, 2017 8:33 AM by Thomas Glaser RSS

    Pie Chart Aggregation

    Thomas Glaser

      I'm trying to create a pie chart that looks like this:



      But I'm confused as to how I can accomplish this. Essentially it shows which users were active and which weren't. So "Activity" would be the count of all users that have any activity. "No Activity" the sum of all users who have no activity at all. I don't quite understand how I have to define the dimension/measurement in this case.


      There's two tables, one with the user names and one with the activities. Simplified, the data looks like this:



      Attached is also an example app. Thanks in advance.

        • Re: Pie Chart Aggregation
          omar bensalem

          Use ValueList.


          Let me explain,

          suppose your have:

          Expression1  : sum of Active users

          Expression2: sum of Inactive users


          To create your pie chart:


          as dimension:


          as measure:

          If(ValueList('Active','Inactive') ='Active',Expression1, if(ValueList('Active','Inactive') ='Inactive',Expression2))

            • Re: Pie Chart Aggregation
              Thomas Glaser

              Thanks a lot, that's one step closer to getting to a solution. I'm not quite sure how to count the users that were active/inactive though. I think this has to be done with a set expression, but I may be wrong. The syntax is really weird. This isn't returning correct results, it should've been 50%/50% with my test data, and it ended up being 33.3%/66.7% for some reason:


              If(ValueList('Active','Inactive') ='Active',Count(UserName),
                 if(ValueList('Active','Inactive')='Inactive',Count( Date={"=Count(Date)>0"}>} UserName ))