Forum Discussion

zach_myt's avatar
zach_myt
Data Pipeline
01-17-2024
Solved

Widget Custom Grouping

I have a pie chart of IP address that is counting logins. I would like to group the IP address that are similar into one group. So if  the IP starts with 172.168.243.xxx then that would be group 1 then 174.166.222.xxx would be group 2. 

I can do this using MySQL statements but I would like to do this in the widget if possible so the elasticube doesn't need to change/build and someone building a dashboard or widget can have the ability to build these.

  • HamzaJ's avatar
    HamzaJ
    01-18-2024

    Hey zach_myt ,

    I will give you an example based on the Sisense sample cube called Sample Healthcare.

    There is a field named RoomID in a table called Admissions. This RoomID ranges from 1 till 60. I want to group those RoomIDs into 3 groups of 20. 1-20 , 21-40, 41-60. Afterwards I want to show those in a piechart;

    The basis:

    What I will do now, is create 3 Measures (remove the Room_id from categories) and filter those measures to create the needed groups. 

    I created 3 measures, each filtered differently:

    After doing this, I can rename those measures by double clicking on it or using the 3 dots to rename:

    If I am not mistaken, this is what you are looking for? Correct?

    Hamza

     

     

     

4 Replies

Replies have been turned off for this discussion
  • HamzaJ's avatar
    HamzaJ
    Data Integration

    Hey zach_myt ,

    This is possible with measure filters. 

    - Create a pie chart

    - Add a measure looking something like this:  (count(<A field>), IP) . Click on IP and filter on the selected ip or set a text-filter. The measure will then only count the fields with that IP . 

    - Duplicate this measure and change the IP-filter. Rinse and repeat. 

    Only downside is that you cannot add categories. If you want that you need to add that to the formula (essentially increasing the number of measures)

    Hamza

  • zach_myt's avatar
    zach_myt
    Data Pipeline

    Hi HamzaJ, thanks for replying but I'm not sure I follow. I have filtered measures enabled. I can also filter but it is on (DUPCOUNT([IP]),[IP]). Currently when I add the filter I am filtering on the count of IP addresses rather than what the IP starts with, such as 174.166.222.xxx.

    I also am unable to rename the groups to anything meaningful, it is a list of IP address. I have attached a pie chart of what I am looking to do with 3 groups, there would then only be 3 categories in the legend of the chart to match the 3 groups in the pie chart.

    Let me know what you think.

    • HamzaJ's avatar
      HamzaJ
      Data Integration

      Hey zach_myt ,

      I will give you an example based on the Sisense sample cube called Sample Healthcare.

      There is a field named RoomID in a table called Admissions. This RoomID ranges from 1 till 60. I want to group those RoomIDs into 3 groups of 20. 1-20 , 21-40, 41-60. Afterwards I want to show those in a piechart;

      The basis:

      What I will do now, is create 3 Measures (remove the Room_id from categories) and filter those measures to create the needed groups. 

      I created 3 measures, each filtered differently:

      After doing this, I can rename those measures by double clicking on it or using the 3 dots to rename:

      If I am not mistaken, this is what you are looking for? Correct?

      Hamza

       

       

       

  • zach_myt's avatar
    zach_myt
    Data Pipeline

    This is perfect! Thanks for the help and thorough explanation.