multiple search criteria aggregates or sql

Hi Team,

I want to filter the result in aggregates based on the search criteria.

User can enter either custName or age

If I add single filter ,It s is working,But With age criteria addition it is not working,Age is an integer ,I have tried texttoInteger(Customer.Age) ,But its is not filtering ,want to enter either of conditions as filter

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" 

Thank you

Hi,

I updated the filter. Please take a look at my updated .oml

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or IntegerToText(Customer.Age) = SearchKeyword 

Cheers,

Khuong

Customer.oml

Hi,

you can try this option also

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or  Index(Customer.Age, SearchKeyword)<>-1

Hi,

You can try as follow: 

PS: Please notice that for age this search exact age. 

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or Customer.Age = TextToInteger(SearchKeyword)

Hi,

If you want to use "like" for filter age, please use this:

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or IntegerToText(Customer.Age) like "%" + SearchKeyword + "%"

Than you ,But if I enter with age as "30" it works with below condition ,But if i enter name as "uj" in search keyword ,It gives error as can not be converted into int

Hi,

Please test in your screen.

Here is my sample.

Cheers,

Khuong

Customer.oml

Hi,

I updated the filter. Please take a look at my updated .oml

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or IntegerToText(Customer.Age) = SearchKeyword 

Cheers,

Khuong

Customer.oml

Thank you Khuong,

It is working now,not sure why not worked for texttoInteger on searchkeyword(Reverseway)


Thank you

Hi ujwala,

the reason is visible in your earlier screenprint : it can't convert a string to an integer.

your were just doing a TextToInteger on any text typed, so of course he will fail if you test with a non-numeric search string.

Dorine

Hi Ujwala,

As Dorine has expained above and as you can see the description of TextToInteger function when using in Aggregate it will throws an exception of value is outside the boundaties of Integer values.

If you want to use it, can add TextToIntegerValidate as the description suggestion.

Here is the updated filter:

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or If(TextToIntegerValidate(SearchKeyword), Customer.Age = TextToInteger(SearchKeyword), False)

Hope this clear for you,

Khuong

Thank you Khuong for clarification.

Hi,

you can try this option also

SearchKeyword="" or Customer.CustName like "%" + SearchKeyword + "%" or  Index(Customer.Age, SearchKeyword)<>-1

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.