how to use a local variable (list of text ) in a Filter inside an Aggregate?

Hello

I have aggregate and list of text, I want to filter aggregate based on the list values, i have 10000 records so looping is not a good option.


Can anyone suggest the best way to do filtering on my aggregate?.


Regards,

Harsha

Hi Harshavardhan t,

You can use filters inside your aggregate:

Or you can use the ListFilter component to retrieve some results based on a condition:

Does this solve your question?

Marco Arede wrote:

Hi Harshavardhan t,

You can use filters inside your aggregate:

Or you can use the ListFilter component to retrieve some results based on a condition:

Does this solve your question?


Hi Marco Arede

Thanks for your reply,

But I want to filter by a list of text, how to achieve it inside aggregate without looping.



Thanks ,

Harsha

Marco Arede wrote:

Hi Harshavardhan t,

You can use filters inside your aggregate:

Or you can use the ListFilter component to retrieve some results based on a condition:

Does this solve your question?

Hi Marco Arede,

I believe Harshavardhan t wants to filter the aggregate result with a variable of type list .The above mentioned solution works for a simple common condition or with normal variable I believe.


 


Pranav Pandey wrote:

Marco Arede wrote:

Hi Harshavardhan t,

You can use filters inside your aggregate:

Or you can use the ListFilter component to retrieve some results based on a condition:

Does this solve your question?

Hi Marco Arede,

I believe Harshavardhan t wants to filter the aggregate result with a variable of type list .The above mentioned solution works for a simple common condition or with normal variable I believe.


 


Hi Pranav Pandey,

Yes, Your understanding is correct. Do you have any solution/suggestion for this?


Thanks,

Harsha


Harshavardhan t wrote:

Pranav Pandey wrote:

Marco Arede wrote:

Hi Harshavardhan t,

You can use filters inside your aggregate:

Or you can use the ListFilter component to retrieve some results based on a condition:

Does this solve your question?

Hi Marco Arede,

I believe Harshavardhan t wants to filter the aggregate result with a variable of type list .The above mentioned solution works for a simple common condition or with normal variable I believe.


 


Hi Pranav Pandey,

Yes, Your understanding is correct. Do you have any solution/suggestion for this?


Thanks,

Harsha


Hi Harshavardhan t,

I don't have much to help but please see my comment in the below post if this could be of help.

https://www.outsystems.com/forums/discussion/47829/search-on-list-of-text/


:(


Solution

Hello Harshavardhan,

There is no way to filter an aggregate based on a text "list" of unknown size.
If the items in the text list will match exactly the content of a field, you can concatenate all the items in a single text variable, and use the following:

Index(TextListInASingleTextVariable, YourEntity.YourAttribute) <> -1

This way you will get this filter to TRUE if the value in an attribute is inside the "list" (actually, the text variable).
But it works only if you are doing exact matches. It will not work with partial matches.

Other than that you can use a SQL tool and pass the string as an input parameter (Expand Inline YES) to compose part of the query (like an IN clause).

You can also bring the results unfiltered and filter in logic with ListFilter, or one of the Forge components available to work with this kind of use cases.

And you could use a third party service, like Elastic Search or something like that.

The solution will depend on your specific needs, budget, etc.

Hope this helps.

Cheers.

Solution

Also, Pranav and Harshavardhan, could you please not hit the "Reply" button and not remove all the previous content, the topic is getting a bit unreadable like this. Thanks!