Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Max of values selected

Hi

I have a field called 'MonthName' with values Jan-Dec.

If multiple values are selected say Jan,Feb,Mar how to find the maximum of the month selected.

I tried giving Max(GetFieldSelections(MonthName)) but i dint ge the Max month selected. It was showing '-'.

Can anyone help me with a correct expression please?

Thanks!

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Max of values selected

=SubField('$(MonthNames)',';',Max(InvoiceMonth))

MonthNames is system Variable

InvoiceMonth you need to replace by your MonthFieldName

View solution in original post

9 Replies
Highlighted
MVP
MVP

Re: Max of values selected

If you have created this field in the script using Month(), you could simply use max like:

If(GetSelectedCount(MonthName), Max(MonthName))

Highlighted

Re: Max of values selected

Hi,

just try max(MonthName)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Highlighted
MVP
MVP

Re: Max of values selected

Use below

=SubField('$(MonthNames)',';',Max(InvoiceMonth))

Highlighted
Creator II
Creator II

Re: Max of values selected

does the table have any date field then on selection of the months

do

MonthName(max([Date Filed]))

Highlighted
Creator III
Creator III

Re: Max of values selected

When i use the above expression its returning 'Jan1990' when Jun is selected.

Highlighted
Master II
Master II

Re: Max of values selected

It seems your monthname is text value not in the date format..

so you can simply load inline data for Monthname and value and link that with you model and then do max of value or else calculate your monthname from a date function.

Date(datefield,'MMM') as monthName

or

load * inline

[

monthname,value

Jan,1

Feb,2

Mar,3

soon

];

HTH

Sushil

Highlighted
Creator III
Creator III

Re: Max of values selected

Is 'MonthNames' an variable? And can i Know what is that InvoiceMonth.Is that the Month field used in you expression?

Highlighted
MVP
MVP

Re: Max of values selected

=SubField('$(MonthNames)',';',Max(InvoiceMonth))

MonthNames is system Variable

InvoiceMonth you need to replace by your MonthFieldName

View solution in original post

Highlighted
Creator III
Creator III

Re: Max of values selected

Thanks a lot for the help.