Hi, I did a search without success. I'd like to filter objects that has not the same value in 2 different attribute (this filter will be used inside a DXL for view's building). something like: f = attribute "Object Type VAL" != attribute "Object Type" Both attribute are enumerations. Right now I'm doing it listening all possible cases but I'm looking for something smarter than this. f = (((attribute "Object Type VAL" != "Heading") && (attribute "Object Type" == "Heading")) || ((attribute "Object Type VAL" != "Test Requirement") && (attribute "Object Type" == "Test Requirement")) || ((attribute "Object Type VAL" != "Support Information") && (attribute "Object Type" == "Support Information")) || ((attribute "Object Type VAL" != "Requirement") && (attribute "Object Type" == "Requirement")) || ((attribute "Object Type VAL" != "") && (attribute "Object Type" == "")) || ((attribute "Object Type VAL" == "") && (attribute "Object Type" != "")))
Thanks a lot in advance.
Regards, Daniele dacapri - Wed Sep 25 04:46:03 EDT 2013 |
Re: how to filter attributes with different values Hello, It looks like attributes are enumerations, but can only contain a single value. I made a filter a while ago that may work, just does the opposite, filters for only when the two attributes match. It can be easily changed by swapping the reject/accept commands.
Hope this helps, Greg
|
Re: how to filter attributes with different values If you do NOT need to save the filter in a view, Greg's accept/reject method looks good. If you DO need to save the Filter in a view, I think your way is the only way using just "Filters". However, you could add an Attr-DXL to do the work, then Filter on whether this single attr is "SAME" or "DIFFERENT"
-Louie |
Re: how to filter attributes with different values llandale - Wed Sep 25 12:48:26 EDT 2013 If you do NOT need to save the filter in a view, Greg's accept/reject method looks good. If you DO need to save the Filter in a view, I think your way is the only way using just "Filters". However, you could add an Attr-DXL to do the work, then Filter on whether this single attr is "SAME" or "DIFFERENT"
-Louie Hello Louie, I'd need to save the filter in a view (using triggers). So, looks like there isn't a direct way to compare them. I'll try with a probe attribute. Many thanks.
Daniele |
Re: how to filter attributes with different values llandale - Wed Sep 25 12:48:26 EDT 2013 If you do NOT need to save the filter in a view, Greg's accept/reject method looks good. If you DO need to save the Filter in a view, I think your way is the only way using just "Filters". However, you could add an Attr-DXL to do the work, then Filter on whether this single attr is "SAME" or "DIFFERENT"
-Louie Thank you Louie. At the end I've used your solution with a Layout-DXL instead of Attr-DXL :
if (probeAttr_(obj, "Object Type VAL") == probeAttr_(obj, "Object Type")) then
display("SAME")
else
display("DIFFERENT")
|