Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Updated Code
Source Link
Allen Mann
  • 1.1k
  • 4
  • 16
  • 37
 "CreatedDate_Hour_3": {
            "datasets": [
                {
                    "id": "0Fb32000000TVRzCAO",
                    "label": "Case_Article_Survey",
                    "name": "Case_Article_Survey",
                    "url": "/services/data/v38.0/wave/datasets/0Fb32000000TVRzCAO"
                }
            ],
            "isFacet": true,
            "isGlobal": false,
            "action""query": "computeExpression",{
            "parameters": {
     "pigql": "q = load \"Case_Article_Survey\";\r\nq = group q by 'CreatedDate_Hour';\r\nq = "source":foreach "CreatedDate_Hour_3",
q generate 'CreatedDate_Hour' as 'CreatedDate_Hour', count() as 'count';\r\nq = order q by 'CreatedDate_Hour' asc;\r\nq = limit "mergeWithSource":q true2000;",
                "computedFields""measures": [
                    {[
                        "name": "CreatedDateNew""count",
                        "type": "Date""*",
                        "format": "MM/dd/yyyy","count"
                    ]
    "saqlExpression": "toDate(CreatedDate_Hour_3 - 8*3600)"
         ],
            }    "action": "computeExpression",
                ]"parameters": {
            }        "source": "CreatedDate_Hour",
            "query"        "mergeWithSource": {true,
                "pigql": "q = load \"Case_Article_Survey\";\r\nq"computedFields": =[
 group q by 'CreatedDateNew';\r\nq = foreach q generate 'CreatedDateNew' as 'CreatedDateNew', count() as 'count';\r\nq = order q by 'CreatedDateNew' asc;\r\nq = limit q 2000;",{
                "measures"            "name": ["CreatedDate_Hour_adjusted",
                    [        "type": "Datetime",
                        "count"    "format": "MM/dd/yyyy HH:mm:ss",
                        "*",    "saqlExpression": "toDate(CreatedDate_Hour  - 8*3600)"
                        "count"}
                    ]
                ]},
                "measuresMap": {},
                "autoFilter": true,
                "groups": [
                    "CreatedDateNew""CreatedDate_Hour"
                ]
            },
            "selectMode": "single",
            "type": "aggregateflex",
            "useGlobal": false,
            "visualizationParameters": {
                "options": {}
            }
        },

I am getting an error that says "This widget can't be displayed because of a problem with the underlying step, CreateDate_Hour_3."This code is not subtracting 8 hours from CreatedDate_Hour.

 "CreatedDate_Hour_3": {
            "datasets": [
                {
                    "id": "0Fb32000000TVRzCAO",
                    "label": "Case_Article_Survey",
                    "name": "Case_Article_Survey",
                    "url": "/services/data/v38.0/wave/datasets/0Fb32000000TVRzCAO"
                }
            ],
            "isFacet": true,
            "isGlobal": false,
            "action": "computeExpression",
            "parameters": {
                "source": "CreatedDate_Hour_3",
                "mergeWithSource": true,
                "computedFields": [
                    {
                        "name": "CreatedDateNew",
                        "type": "Date",
                        "format": "MM/dd/yyyy",
                        "saqlExpression": "toDate(CreatedDate_Hour_3 - 8*3600)"
                    }
                ]
            },
            "query": {
                "pigql": "q = load \"Case_Article_Survey\";\r\nq = group q by 'CreatedDateNew';\r\nq = foreach q generate 'CreatedDateNew' as 'CreatedDateNew', count() as 'count';\r\nq = order q by 'CreatedDateNew' asc;\r\nq = limit q 2000;",
                "measures": [
                    [
                        "count",
                        "*",
                        "count"
                    ]
                ],
                "measuresMap": {},
                "autoFilter": true,
                "groups": [
                    "CreatedDateNew"
                ]
            },
            "selectMode": "single",
            "type": "aggregateflex",
            "useGlobal": false,
            "visualizationParameters": {
                "options": {}
            }
        },

I am getting an error that says "This widget can't be displayed because of a problem with the underlying step, CreateDate_Hour_3."

 "CreatedDate_Hour_3": {
            "datasets": [
                {
                    "id": "0Fb32000000TVRzCAO",
                    "label": "Case_Article_Survey",
                    "name": "Case_Article_Survey",
                    "url": "/services/data/v38.0/wave/datasets/0Fb32000000TVRzCAO"
                }
            ],
            "isFacet": true,
            "isGlobal": false,
            "query": {
                "pigql": "q = load \"Case_Article_Survey\";\r\nq = group q by 'CreatedDate_Hour';\r\nq = foreach q generate 'CreatedDate_Hour' as 'CreatedDate_Hour', count() as 'count';\r\nq = order q by 'CreatedDate_Hour' asc;\r\nq = limit q 2000;",
                "measures": [
                    [
                        "count",
                        "*",
                        "count"
                    ]
                ],
                "action": "computeExpression",
                "parameters": {
                    "source": "CreatedDate_Hour",
                    "mergeWithSource": true,
                    "computedFields": [
                        {
                            "name": "CreatedDate_Hour_adjusted",
                            "type": "Datetime",
                            "format": "MM/dd/yyyy HH:mm:ss",
                            "saqlExpression": "toDate(CreatedDate_Hour  - 8*3600)"
                        }
                    ]
                },
                "measuresMap": {},
                "autoFilter": true,
                "groups": [
                    "CreatedDate_Hour"
                ]
            },
            "selectMode": "single",
            "type": "aggregateflex",
            "useGlobal": false,
            "visualizationParameters": {
                "options": {}
            }
        },

This code is not subtracting 8 hours from CreatedDate_Hour.

Source Link
Allen Mann
  • 1.1k
  • 4
  • 16
  • 37

Change Time Zone in Wave Dashboard

I am using page 28 of this doc for reference: https://resources.docs.salesforce.com/200/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf

I need to change the time zone in the step. I am trying to use the computeExpression action to handle it. Here is the code I tried:

 "CreatedDate_Hour_3": {
            "datasets": [
                {
                    "id": "0Fb32000000TVRzCAO",
                    "label": "Case_Article_Survey",
                    "name": "Case_Article_Survey",
                    "url": "/services/data/v38.0/wave/datasets/0Fb32000000TVRzCAO"
                }
            ],
            "isFacet": true,
            "isGlobal": false,
            "action": "computeExpression",
            "parameters": {
                "source": "CreatedDate_Hour_3",
                "mergeWithSource": true,
                "computedFields": [
                    {
                        "name": "CreatedDateNew",
                        "type": "Date",
                        "format": "MM/dd/yyyy",
                        "saqlExpression": "toDate(CreatedDate_Hour_3 - 8*3600)"
                    }
                ]
            },
            "query": {
                "pigql": "q = load \"Case_Article_Survey\";\r\nq = group q by 'CreatedDateNew';\r\nq = foreach q generate 'CreatedDateNew' as 'CreatedDateNew', count() as 'count';\r\nq = order q by 'CreatedDateNew' asc;\r\nq = limit q 2000;",
                "measures": [
                    [
                        "count",
                        "*",
                        "count"
                    ]
                ],
                "measuresMap": {},
                "autoFilter": true,
                "groups": [
                    "CreatedDateNew"
                ]
            },
            "selectMode": "single",
            "type": "aggregateflex",
            "useGlobal": false,
            "visualizationParameters": {
                "options": {}
            }
        },

I am getting an error that says "This widget can't be displayed because of a problem with the underlying step, CreateDate_Hour_3."