How to track percentage of increase and decrease in record count of table using metrics and checks.

Solved!
PK36313
Level 2
How to track percentage of increase and decrease in record count of table using metrics and checks.

Hello,

I have a requirement to track the percentage of increase or decrease of the table count each time when scenario get trigger and build got completed . 

Can someone guide me how can I enable this using using metrics and checks.

Thanks in advance

0 Kudos
1 Solution
MiguelangelC
Dataiker

Hi,

You could add a an extra 'Execute Python code' step to your scenario to gather the desired metric data. This step would run after the dataset build and use the DSS Python API to query for the desired metrics.

The method get_metric_history will allow you to get the full dataset metric information.

For example, to get the historical of the row counts for a database table:

import dataiku
mydataset = dataiku.Dataset("orders_prepared_db")
for i in mydataset.get_metric_history("record count")["values"]:
print(i["value"])

 

 

 

View solution in original post

0 Kudos
1 Reply
MiguelangelC
Dataiker

Hi,

You could add a an extra 'Execute Python code' step to your scenario to gather the desired metric data. This step would run after the dataset build and use the DSS Python API to query for the desired metrics.

The method get_metric_history will allow you to get the full dataset metric information.

For example, to get the historical of the row counts for a database table:

import dataiku
mydataset = dataiku.Dataset("orders_prepared_db")
for i in mydataset.get_metric_history("record count")["values"]:
print(i["value"])

 

 

 

0 Kudos

Labels

?
Labels (3)
A banner prompting to get Dataiku