Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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*
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.
Example:
Load Month, MaxString(Month) as LastSalesMonth from abc.csv group
by Year;
Hi,
PFA. It helps you regarding string functions and examples.
Regards,
Khadeer
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?
Hi,
maxstring gives you the string that is last in the ascending list of strings
HTH
Ravi N.
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.
perhaps this illustrates the difference between Max and MaxString
HTH
Jonathan
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.