Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Maxstring???

Good morning all,

This might be a silly question...but hey!

I have a script that I am using, but the script is written by someone else.

Can someone please explain the use of maxstring to me?

I am still new at Qlikview and don't know all the terminology and use thereof.

Thank you

*R*

12 Replies
Not applicable
Author

The Maxstring function just picks the maximun string value on a list of Strings. For example:

Maxstring(alphabet) would return 'Z', taking into acount that alphabet is a field that contains all the letters of the alphabet. Simple.

tresesco
MVP
MVP

In SCRIPT (from help):

Returns the last text value of expression over a
number of records, as defined by a group by clause. If
no text value is found, NULL is returned.

Example:

Load Month, MaxString(Month) as LastSalesMonth from abc.csv group
by Year;

khadeer
Specialist
Specialist

Hi,

PFA. It helps you regarding string functions and examples.

Regards,

Khadeer

Not applicable
Author

All you've done is copy a chunk from the QlikView Reference manual. This doesn't help us QlikView beginners at all. How about explaining in plain English with a good, clear and simple example which can be understood by those who are new to QlikView.

ThornOfCrowns
Specialist II
Specialist II

To be fair, the reply by tresesco does exactly what you ask, it explains the function, gives an example and guides the OP to the relevant part of the Help file.

What more would you want in an answer to a question practically a year old?

Anonymous
Not applicable
Author

Hi,

maxstring gives you the string that is last in the ascending list of strings

HTH

Ravi N.

tresesco
MVP
MVP

I don't agree. Reference manual doesn't help biginners ! I believe that's the best place to start with. However, let me try to put it in a different way (might not be a simpler one).

Two cases of uses:

Front-end chart:

Returns the maximum string(as the sort is considered here is 'text') from a lot of records.

Script:

Returns the last text value from a lot of records that come under a group depending on group by clause.

This would be clearer to you once you try and see the outcome in practical. Create a sample qvw and play with it.

jonathandienst
Partner - Champion III
Partner - Champion III

perhaps this illustrates the difference between Max and MaxString

Example.png

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

And for a dual value, both Max and Maxstring return the highest numerical field value. Max return the numerical value of the field and MaxString returns the text representation of the same field value.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein