Maximal size of the attribute entries

s_nektarijevic
s_nektarijevic New Altair Community Member
edited November 2024 in Community Q&A
Dear RapidMiners,

Happy new year to everyone!

The new year already brings new questions! Here is one from me:

Is it possible to get the maximal length of the strings contained in an an attribute? For example, if in an attribute I am storing titles of web pages, is there an elegant way to retrieve the length of the longest title?

Many thanks in advance!

Cheers,
Snezana
Tagged:

Best Answers

  • kypexin
    kypexin New Altair Community Member
    Answer ✓
    Hi Snezana,

    One way for doing this might be using 'Generate attributes' operator and length() function on a nominal attribute containing web page name, then using Sort operator to sort by that new attribute containing the length values.


  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    to add to @kypexin comment: Instead of sort you could use an Aggreate operator to directly get max(len).

    BR,
    Martin

Answers

  • kypexin
    kypexin New Altair Community Member
    Answer ✓
    Hi Snezana,

    One way for doing this might be using 'Generate attributes' operator and length() function on a nominal attribute containing web page name, then using Sort operator to sort by that new attribute containing the length values.


  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    to add to @kypexin comment: Instead of sort you could use an Aggreate operator to directly get max(len).

    BR,
    Martin
  • s_nektarijevic
    s_nektarijevic New Altair Community Member
    Thanks a lot @kypexin and @mschmitz !

    A combination of your hints helped me to get what I needed!