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 across it's category for example How much % sales did Adidas from all brands across sports category

My hierarchy goes as follows

shopping centre

category ex clothing, sports etc

Brand/Store ex adidas

Now I am using (sum(sales), category) formula here but for this I have to pre select my category where I want this to be dynamic based on the brand selection on dashboard level. Hope this makes sense. Any help would be appreciated thanks

  • 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

     

     

1 Reply

Replies have been turned off for this discussion
  • harikm007's avatar
    harikm007
    Data Warehouse

    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