Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limit Chart Minimum Only When Needed

Hi,

I have a line chart where the values are between 100 and -500 (Y values this means).

I want to limit the scale to a minimum of -100, but only when it's needed.

What I mean is that when there are indeed values surpassing -100, it should limited to -100, otherwise it should be limited to the lowest value present (as it would have if I haven't changed the scale's static min).

This gets a bit trickier as I can't use simply 'if(min(aggr(exp,diam))<-100,-100,min(aggr(exp,diam))' because I have multiple conditional dimensions where only two are enabled each time.

Thanks for your help!


Edit: Attached is a simplified example of my chart.

It shows 'Amount' over time, where time could be Months or Quarters (can be selected from the list box).

What I want that if the chart would have values under -100, it would limit it to -100 (for example, months 6, 7, 8, 9, 10 selected),

But if months 1, 2, 3, 4, 5 are selected, the minimum would be 10 (and not -100).

And all of that should work both when month and quarter are selected as Date Types.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

you can use this for the Axis static min:

If(getfieldselections([DateType])='Month', RangeMax(-100, Min(Aggr(Sum(amount), Month))),

RangeMax(-100, Min(Aggr(Sum(amount), Quarter))))

But QV seems to be confused by the static min as it moves the clipped data points. See the attached for a comparison with and without the static minimum.

HTH

Jonathan

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

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hi Amalin,

Could you attach a sample?

Thanks

Not applicable
Author

I have edited the message and added the attachment.

Thanks!

rubenmarin

Hi amalin,

Is there is always two dimensions you can use variables to use expression like:

if(min(aggr(sum(amount),$(vDim1), $(vDim2)))<-100,-100,min(aggr(sum(amount),$(vDim1), $(vDim2))))

Hope this helps

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

you can use this for the Axis static min:

If(getfieldselections([DateType])='Month', RangeMax(-100, Min(Aggr(Sum(amount), Month))),

RangeMax(-100, Min(Aggr(Sum(amount), Quarter))))

But QV seems to be confused by the static min as it moves the clipped data points. See the attached for a comparison with and without the static minimum.

HTH

Jonathan

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

Or even simpler:

RangeMax(-100, Min(Aggr(Sum(amount), $(=getfieldselections([DateType])))))

(so long as the values in DateType are actual field names)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

amalin66,

Use Jonathan's solution, it is the best for your purpose.



Not applicable
Author

Thanks!

I had adjust it, but it worked like a charm.