Scenario: Instead of creating 2 widgets for Count of Opportunity and Sum of Amount, we need a toggle that lets the user switch between count and sum.
1. Group the widget as per normal, with Count of Rows or Sum of Amount
2. Add Static Query
"static_1": {
"broadcastFacet": true,
"columns": {},
"selectMode": "singlerequired",
"start": {
"display": [
"Amount"
]
},
"type": "staticflex",
"values": [
{
"display": "Amount",
"value": [
"sum",
"Amount"
]
},
{
"display": "Count",
"value": [
"count",
"*"
]
}
],
"numbers": [],
"strings": [],
"groups": []
}
3. Update the Query
From:
"field": [
"count",
"*"
]
To: "field": "{{cell(static_1.selection, 0, \"value\").asObject()}}",
No comments:
Post a Comment