
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 08:26 PM - edited 07-10-2023 08:26 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 09:51 PM
I'm still unclear with the requirements. I tired something similar in my PDI and seems working. Hope this helps!.
Hope it helps and please mark helpful if it solves the issue.
Thanks,
Pooja Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 08:32 PM
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
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 08:46 PM
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 09:51 PM
I'm still unclear with the requirements. I tired something similar in my PDI and seems working. Hope this helps!.
Hope it helps and please mark helpful if it solves the issue.
Thanks,
Pooja Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 02:20 PM - edited 07-24-2023 02:25 PM
Sorry for not being so clear, but your answer helped me to solve my problem. Thanks @POOJA SINGH18