Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku!

# Scenario Conditional on Dataset Metric

Solved!
Level 1
###### Scenario Conditional on Dataset Metric

Hi Community!

I would like to be able to have an automated scenario that runs through if a dataset's record count metric is > 0 but halts (also with SUCCESS) if the record count metric == 0.

More specifically, and by way of illustration, a scenario that does:

Step#1: build dataset A

Step#2: compute metrics on dataset A

Step#3: set a scenario variable v = row count metric on dataset A

Step#4: build dataset B if v > 0

Any ideas would be really welcome, thanks!

Nik

1 Solution
Dataiker

Hi Nik,

You can add a check on the metric row_count.
A check is a condition that depends on a metric, here the check would be a success if it's above or equal 1:

If not the check is going to fail.

- step 3 is: run this check.
- step 4 is: build dataset B if no prior step failed. (you have this option in the step options)

Matt

Mattsco
3 Replies
Dataiker

Hi Nik,

You can add a check on the metric row_count.
A check is a condition that depends on a metric, here the check would be a success if it's above or equal 1:

If not the check is going to fail.

- step 3 is: run this check.
- step 4 is: build dataset B if no prior step failed. (you have this option in the step options)

Matt

Mattsco
Level 1
Author

Thank you Matt!

I've accepted this at it gets what I need done, done - is there a way that I could have such a scenario conclude in a SUCESS, however? The build doesn't happen, which is great, but this isn't really a failure - everything has run correctly...

Thanks again,

Nik

niko, if you are still looking for an answer on how to do this without failures look at my post:

https://community.dataiku.com/t5/Using-Dataiku/Conditional-execute-of-scenario-step-without-steps-fa...