I'm working on incident management application. I'm trying to filter the below table by using the String (present in the AttachCondition column) as a statement by passing the local variable values to Priority and Assignment group. I want True or False value. So, there can be only one row with True value.
I tried filtering the aggregate like in the below image but the string contains "<>" operator also. if there is only "=" operator I can filter easily.
Please pour your suggestions guys.
Hi Kumar Chandrasekaran,
In this case, i think you will need two more variables to hold the signal values (for example: PrioprityStatus (type: text) and AssignmentGroupStatus (type: text) and assign if it is equal ("=") or not ("<>").
Hi Kumar,
just some initial thoughts :
It feels like this has been under-engineered. Codifying logic and relations among things in your datamodel into a string in a single column is asking for trouble, as there will always have to be the action of unravelling what exactly the string means, as in for example this query of yours.
This is some sort of rule set about what SLA is applicable to a specific incident. I would suggest modelling your rules with real entities and foreign keys, rather than compressing them into a string.
If you don't have acces / authority to change the design of this SLA config table, I would suggest first braking down the rules into a modelled cache of those rules, and then apply your query on that cache.
Dorine
To expand on my answer,
using that condition on your incident should not pose such a problem, but you might need an sql widget instead of an aggregate
Hello @Dorine Boudry Thanks for the reply. I suggested my application architect to separate the attributes instead of putting altogether as a string. my application architect wants this kind of string condition only. It should be dynamic, there can be many attributes in a condition but the SLA should be filtered based on the incident details like priority, assignment group, category, location and configuration item etc.,
Please help me, if there is any other solution other than matching the string or search filter using like.
Very weird... Why he wants this? If we want this to create dynamic SQL maybe I can understand anyway is very bad practice, and for sure the performance will be very bad.
For this difficult queries you should use Advanced SQL.