0

I've got a problem. I'm trying to display the "%" in my number widget. It's easy with only one dataset but in my case I got two datasets. I want to take the budget value from Budget and sales value from Sales.

Basically I'm using this formula : (budget+sales)/sales

When I run the query I lose all my formats and my value is display as a number and not as a percentage value. I tried to bind my measures using something like that :

                "columns": [
                    {
                        "query": {
                            "measures": "{{cell(sales_6.selection, 0, \"sum_sales\").asObject()}}",
                            "groups": [
                                "date_Year"
                            ]
                        }
                    },
                    {
                        "query": {
                            "measures": [
                                [
                                    "sum",
                                    "budget"
                                ]
                            ],
                            "groups": [
                                "date_Year"
                            ]
                        }
                    },
                    {
                        "query": {
                            "measures": [
                                [
                                    "sum",
                                    "budget"
                                ]
                            ],
                            "groups": [
                                "date_Year"
                            ],
                            "formula": "(A-B)/B"
                        },
                        "format": "percentage"
                    }
                ]

But nothing is displaying and I got this message when I hit show details

more details

So I tried with something else :

            "datasets": [
                {
                    "id": "0Fb1X0000000cr8SAA",
                    "label": "Sales",
                    "name": "Sales",
                    "url": "/services/data/v45.0/wave/datasets/0Fb1X0000000cr8SAA"
                },
                {
                    "id": "0Fb1X0000000fc6SAA",
                    "label": "Budgets",
                    "name": "Budgets",
                    "url": "/services/data/v45.0/wave/datasets/0Fb1X0000000fc6SAA"
                }
            ]

Here I added the other dataset to my array and changed my measure just by adding :

                        "measures": [
                            [
                                "sum",
                                "sales"
                            ]
                        ]

But my widget doesn't detect the dataset.

Is there a way to bind the measures or at least display the percentage symbol (%) ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.