1

When metrics are calculated from a step, and not in the source database, how can the format the calculated metric be edited? Perhaps the JSON or the XMD (where would this live for the calculated metric because it's not in the source dataset)?

Here is a post that talks about editing XMD for the dataset, but I can't figure out how to edit the calculated metric.

How to convert decimals to a percentage in Wave Saql querry reuslt

Thanks for any help or pointers to how to solve.

0

You are able to add in derived measures and derived dimensions in the XMD file. These are fields that do not exist in the dataset itself but have been created by your queries. Below is an example that will hopefully help.

Make sure that all of the dimensions and measures in your dataset are included in the XMD. Then you can add your calculated fields in the derivedDimensions and derivedMeasures section.

{
"dataset": {},
"dates": [{
    "alias": "DATASET_REFRESH_TM",
    "fields": {
        "day": "DATASET_REFRESH_TM_Day",
        "epochDay": "DATASET_REFRESH_TM_day_epoch",
        "epochSecond": "DATASET_REFRESH_TM_sec_epoch",
        "fiscalMonth": "DATASET_REFRESH_TM_Month_Fiscal",
        "fiscalQuarter": "DATASET_REFRESH_TM_Quarter_Fiscal",
        "fiscalWeek": "DATASET_REFRESH_TM_Week_Fiscal",
        "fiscalYear": "DATASET_REFRESH_TM_Year_Fiscal",
        "fullField": "DATASET_REFRESH_TM",
        "hour": "DATASET_REFRESH_TM_Hour",
        "minute": "DATASET_REFRESH_TM_Minute",
        "month": "DATASET_REFRESH_TM_Month",
        "quarter": "DATASET_REFRESH_TM_Quarter",
        "second": "DATASET_REFRESH_TM_Second",
        "week": "DATASET_REFRESH_TM_Week",
        "year": "DATASET_REFRESH_TM_Year"
    },
    "firstDayOfWeek": -1,
    "fiscalMonthOffset": 0,
    "isYearEndFiscalYear": true,
    "label": "DATASET_REFRESH_TM",
    "showInExplorer": true
}],
"derivedDimensions": [{
    "customActions": [],
    "customActionsEnabled": true,
    "field": "OPPTY_NM",
    "isMultiValue": false,
    "label": "Opportunity Name",
    "linkTemplateEnabled": true,
    "members": [],
    "recordDisplayFields": [],
    "salesforceActions": [],
    "salesforceActionsEnabled": true,
    "showInExplorer": false
}, {
    "customActions": [],
    "customActionsEnabled": true,
    "field": "barColor",
    "isMultiValue": false,
    "label": "barColor",
    "linkTemplateEnabled": true,
    "members": [{
        "color": "#14713E",
        "member": "GreenBar"
    }, {
        "color": "#E16032",
        "member": "RedBar"
    }],
    "recordDisplayFields": [],
    "salesforceActions": [],
    "salesforceActionsEnabled": true,
    "showInExplorer": false
}],
"derivedMeasures": [{
    "field": "Count_YoY",
    "format": {
        "customFormat": "[\"##%\", 1]"
    },
    "label": "Count YoY",
    "showInExplorer": false
}, {
    "field": "CH1",
    "format": {
        "customFormat": "[\"$##,###\",1]"
    },
    "label": "Cohort 1",
    "showInExplorer": false
}],
"dimensions": [{
    "customActions": [],
    "field": "USER_NM",
    "label": "User Name",
    "linkTemplateEnabled": true,
    "members": [],
    "recordDisplayFields": [],
    "salesforceActions": [],
    "salesforceActionsEnabled": true
}],
"measures": [{
    "field": "Dollars",
    "format": {},
    "label": "Dollars"
}],
"organizations": [],
"showDetailsDefaultFields": []

}

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.