Discussion Board for collaboration related to QlikView App Development.
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.
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.
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.
Load Month, MaxString(Month) as LastSalesMonth from abc.csv group
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.
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?
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:
Returns the maximum string(as the sort is considered here is 'text') from a lot of records.
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.
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.