0 votes

Hello,

I have set up a scenario which returns a Slack message upon completion, along with some standard variables (e.g., ${scenarioName}). By following the documentation here https://doc.dataiku.com/dss/latest/scenarios/variables.html ("Retrieving the value of a metric") I have been able to get the entire output from the metrics computation (${stepOutput_the_metrics}).

However, I would like to limit the content of the Slack message to the number of rows of the dataset (i.e., the value of the COUNT_RECORDS metric). When I try and follow the rest of the documentation, I cannot follow; especially the section "If the goal is to retrieve the value of the metric col_stats:MIN:cost, with a bit of filtering one obtains this status with ${filter(parseJson(stepOutput_the_metrics)[‘PROJ.computed’].computed, x, x.metricId == ‘col_stats:MIN:cost’)[0].value}"

I want to replicate this, but for my circumstances, but I am unable to. What does the x refer to here? 

If I wanted to the value of the metric "metricId:records:COUNT_RECORDS", how would I do this?

asked by

1 Answer

0 votes

Hi Mark,

Let's assume that inside your scenario, you have one "Compute metrics" step named "the_metrics", which has one dataset called "test" in the project "SANDBOX" with the metric "metricId:records:COUNT_RECORDS" configured.

Then you can retrieve the value of the metric using:

${filter(parseJson(stepOutput_the_metrics)[‘SANDBOX.test’].computed, x, x.metricId == ‘metricId:records:COUNT_RECORDS’)[0].value}

I put in bold the parameters that you need to change:

1. Name of the "Compute metrics" step: "the_metrics"

2. Project key: "SANDBOX"

3. Dataset name: "test"

4. Metric identifier: "metricId:records:COUNT_RECORDS"

Hope it helps,

Alex

answered by
971 questions
998 answers
1,047 comments
2,361 users

©Dataiku 2012-2018 - Privacy Policy