4 Replies Latest reply: Feb 11, 2015 11:12 AM by Richard Chilvers

# Maximum of a set of selected values

I have a chart showing sales values, and I allow the user to select which week or weeks they would like to show the values for. So they might select weeks 3,4 and 5.

I would like to have an extra chart which shows the total value from week 1 to the max week selected (so weeks 1-5 in my example).

Is there a function to select the max value in this way ?

Thanks

Richard

• ###### Re: Maximum of a set of selected values

No, you have to manage strings, in my example if your field is DIM then

=Mid(GetFieldSelections(DIM,',',50), Index(GetFieldSelections(DIM,',',50), ',', -1)+1)

let me know

• ###### Re: Maximum of a set of selected values

set analysis :

sum({<Week={>=1,<=\$(=max(Week)} value)

update:

Sum({<Week={">=1<=\$(=Max(Week))"}>} Value)

• ###### Re: Maximum of a set of selected values

Thank you for your fast response and correct solution to my problem.

• ###### Re: Maximum of a set of selected values

Hi Richard,

In a simple example, if Week is a numeric field and expression is Sum(Sales), you can use:

Sum({<Week={'<=\$(=Max(Week))'}>} Sales)

If user selects weeks 3-5, the Bold part tells qv to ignore week selection and calculate the expression like if Week selection was "<=5"