Forum Discussion

nikitabansal's avatar
nikitabansal
Cloud Apps
08-03-2022
Solved

Share of wallet

Hello I am new to sisense and trying to achieve a very simple view  My dashboard is being filtered for a selected brand (user can change this)  I would like to see the % contribution of this brand ...
  • harikm007's avatar
    08-04-2022

    Hi nikitabansal ,

    You can use Blox to do this. Create a blox widget with Category and Brand as 'Items' and use below formula.

    sum([Sales])/(sum([Sales]), all([Brand]))

     

    Here is the Blox script I used for above widget

    {
        "style": "",
        "script": "",
        "title": "",
        "showCarousel": true,
        "body": [
            {
                "spacing": "medium",
                "type": "Container",
                "items": [
                    {
                        "spacing": "small",
                        "type": "TextBlock",
                        "text": "Percentage",
                        "color": "default",
                        "horizontalAlignment": "center"
                    },
                    {
                        "type": "TextBlock",
                        "text": "{panel:Percentage}",
                        "horizontalAlignment": "center",
                        "size": "extraLarge",
                        "style": {
                            "color": "#117899"
                        }
                    }
                ]
            }
        ],
        "actions": []
    }

     

    -Hari