Here is one way to filter a date range. There is a more 'proper way' which is using the .asDateRange() serialization but this works too. A awesome explanation of these bindings is in www.salesforceblogger.com by Rikke. :-)
"query": "q = load \"{{column(DistrictStep_SAFCreated.selection,[\"datasetSAF30d\"]).asObject()}}\";\nq = filter q by date('CreatedDate_Year', 'CreatedDate_Month', 'CreatedDate_Day') in [dateRange({{column(dayFilter.selection,[\"weekRange\"]).asObject()}})];\nq = group q by 'newContact' ;\nq = foreach q generate 'newContact' as 'Specialist', count() as 'SAF Last Wk';q = order q by 'SAF Last Wk' desc;\n", You would create a static query called dayFilter and have the following in the JSON. "dayFilter": { "broadcastFacet": true, "columns": { "weekRange": { "type": "string" }, "Display": { "type": "string" } }, "label": "", "selectMode": "singlerequired", "type": "staticflex", "values": [ { "Display": "Nov24", "weekRange": "[2019,11,24], [2019,11,30]" }, { "Display": "Dec1", "weekRange": "[2019,12,1], [2019,12,7]" },
0 Comments
Leave a Reply. |
|