Is it possible to have numbers with comparison operators?

Resolved
Nikita asked on February 22, 2024

We wonder if Flexmonster can handle such numbers as '<=50' or '>40' with comparison operators prepending number values? Currently if we have such numbers it causes Flexmonster to switch its behavior to only counting the number of items instead of averaging them out. We wonder if there are any configs that could allow that or we need to strip these operators from numbers first.

4 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster February 23, 2024

Hello, Nikita!
 
Thank you for reaching out to us.
 
Kindly note that by default, Flexmonster recognizes field data types automatically, so it considers the fields with special symbols and numbers as string fields. You can explicitly set the number data type to such fields using mapping.
We have prepared an example to illustrate the idea: https://jsfiddle.net/flexmonster/9d6ogew2/. Please note that special symbols like ">" or "<=" are ignored when converting a field to a number.
 
Hope it helps.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster March 7, 2024

Hello, Nikita!

Hope you are doing well.

Our team is wondering if you had some time to look at our example of explicitly setting the data type using mapping. Could you please let us know if it was helpful?

Looking forward to hearing your feedback.

Kind regards,
Solomiia

Public
Nikita March 8, 2024

Sure, it helped a lot. Currently we decided to strip away operators and just feed the data without them, but its good to know that we can avoid that too. 
Thank you!

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster March 11, 2024

Hello, Nikita!

Thank you for your feedback.

Our team is glad to hear everything works well for you.

Feel free to reach out to us in case of any other questions.

Regards,
Solomiia

Please login or Register to Submit Answer