Metric Definition filter script

Leandro Oliveir
Tera Contributor

Hello everyone,

 

I need to make a filter (by script) where a Metric Definition only works on a certain catalog item.

I created a property to get the sys_id of the item and handle it in the script, but I stuck in logic to make this filter work. What correct logic to achieve this?

 

Regards,

Leandro Oliveira

1 ACCEPTED SOLUTION

Hi @Leandro Oliveir 

 

I'm still unclear with the requirements. I tired something similar in my PDI and seems working. Hope this helps!.

POOJASINGH18_0-1689050988552.png

 

Hope it helps and please mark helpful if it solves the issue.

Thanks,

Pooja Singh

View solution in original post

4 REPLIES 4

Tony Chatfield1
Kilo Patron

Hi, your post details are a little unclear, but for a metric definition I would expect a syntax of something like
if(current.sys_id == 'xxxx') {

//do something

}

This 'do something' is the logic I want to achieve.

Let me explain better:
This metric is configured to work on table sc_req_item , on the field state and type field value duration.
The filter that I want to create in the script field must be used to select only the specific catalog item (for this purpose I created a property with the sys_id of this catalog item).

Hi @Leandro Oliveir 

 

I'm still unclear with the requirements. I tired something similar in my PDI and seems working. Hope this helps!.

POOJASINGH18_0-1689050988552.png

 

Hope it helps and please mark helpful if it solves the issue.

Thanks,

Pooja Singh

Sorry for not being so clear, but your answer helped me to solve my problem. Thanks @POOJA SINGH18