0

I have a requirement to show results by quarter, month and week on select on toggle options. This toggle is a static step with values as "Quarter", "Month" and "Week".

below is my static step and chart query:

Static Step:

"static_1": {
                "type": "staticflex",
                "numbers": [],
                "strings": [],
                "groups": [],
                "columns": {
                    "display": {
                        "type": "string"
                    },
                    "Dimension2": {
                        "type": "grouping",
                        "dataset": {
                            "name": "dataset1"
                        }
                    }
                },
                "broadcastFacet": true,
                "selectMode": "singlerequired",
                "values": [
                    {
                        "display": "Quarter",
                        "value": "Close_Date__c_Quarter"
                    },
                    {
                        "display": "Month",
                        "value": "Close_Date__c_Month"
                    },
                    {
                        "display": "Week",
                        "value": "Close_Date__c_Week"
                    }
                ],
                "label": ""
            }

Chart query:

 "query": {
                    "columns": [
                        {
                            "query": {
                                "measures": [
                                    [
                                        "sum",
                                        "Total_Closed_Hours"
                                    ]
                                ],
                                "groups": [
                                    "Close_Date__c_Year",
                                    "{{coalesce(cell(static_1.selection, 0, \"value\"), cell(static_1.result, 0, \"value\")).asString()}}"
                                ]
                            }
                        },
                        {
                            "query": {
                                "measures": [
                                    [
                                        "sum",
                                        "Total_Used_Hours"
                                    ]
                                ],
                                "groups": [
                                    "Close_Date__c_Year",
                                    "{{coalesce(cell(static_1.selection, 0, \"value\"), cell(static_1.result, 0, \"value\")).asString()}}"
                                ]
                            }
                        }
                    ],
                    "measures": [
                        [
                            "sum",
                            "Total_Closed_Hours",
                            "A"
                        ],
                        [
                            "sum",
                            "Total_Used_Hours",
                            "B"
                        ]
                    ],
                    "groups": [
                        "Close_Date__c_Year"
                    ]
                }

Below is the output of my above JSON:

Output

If you see the above image, when quarter is selected, I could see 4 rows but the labels arent getting displayed like Q1, Q2, Q3, Q4. Same happening when Month and Week are selected. I could see 12 and 52 rows respectively instead of month and week values.

Can anyone please suggest any update to my JSON above so that I can able to display the respected toggle value as column when selected.

Thanks!

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.