Skip to main content
Solved

Querying lists based on attribute values

  • September 8, 2020
  • 5 replies
  • 306 views

declancoleman1
Contributor

I am currently looking for a way to query a list to either return all the values that contain the value found in an attribute or return the list index for these values.

 

I have currently managed to return the list index for the first value in the list to meet this query using a ListSearcher but can't seem to figure out how to return all values.

 

Best answer by bwn

If you are like me and too bad/too lazy to write Python then an alternative would be as below.

 

This is the quickest way I know of that is stock Transformer based. You can minimise the amount of processing time that ListExploder takes by first removing all attributes that aren't absolutely needed using an AttributeRemover, leaving just a Unique Row ID and the List to Search itself.

capture

 

 

In this example I just kept it simple and searched for a RegEx expression of "1" and it returned in a Separate List all the List Indices that had the value of 1

capture1

View original
Did this help you find an answer to your question?

5 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • September 8, 2020

If you don't want to explode the list (and you probably don't looking at the length) then you're probably looking at a python solution


Forum|alt.badge.img+2
  • September 8, 2020

@declancoleman1​  I agree with @ebygomm​  You'll probably have to develop a short Python script. There is a simple example that is part of the Advanced Attribute and List Handling Course, at the end of the chapter Transformers for Working with List Attributes - section Python & List Attributes and the example workspace Python_example_2020.fmwt


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • Best Answer
  • September 9, 2020

If you are like me and too bad/too lazy to write Python then an alternative would be as below.

 

This is the quickest way I know of that is stock Transformer based. You can minimise the amount of processing time that ListExploder takes by first removing all attributes that aren't absolutely needed using an AttributeRemover, leaving just a Unique Row ID and the List to Search itself.

capture

 

 

In this example I just kept it simple and searched for a RegEx expression of "1" and it returned in a Separate List all the List Indices that had the value of 1

capture1


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • September 9, 2020
markatsafe wrote:

@declancoleman1​  I agree with @ebygomm​  You'll probably have to develop a short Python script. There is a simple example that is part of the Advanced Attribute and List Handling Course, at the end of the chapter Transformers for Working with List Attributes - section Python & List Attributes and the example workspace Python_example_2020.fmwt

@Mark Stoakes​ just a note that the Links and Attachments on those two pages are unfortunately broken :(


declancoleman1
Contributor

This did the trick perfectly thanks a lot!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings