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

RangeSum() and Above()

Hey fellas.

I've found a solution to an issue I have which works (almost) perfectly however I'm struggling to understand how it works.

The original solution I found here and was solved by swuehl...

Accumulation Line Chart can not stop to current month

Essentially it's this expression...

if(

     Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     rangesum(Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     above("Fred")

))

My main issue (aside from not really understanding what any of it is doing) is the "Fred". I understand that this refers to itself i.e. its label, however I don't want a static label. The label is '=selected_year' without the quotes.

So what do i need to put in place of "Fred" so that the expression works and the label changes with the year selected?

Thanks,

Foldy.

1 Solution

Accepted Solutions
sunny_talwar

Or I might say 'Fred'. Try

if(

    Sum ({<financial_year={'$(=selected_year)'}  >} budget),

    rangesum(Sum ({<financial_year={'$(=selected_year)'}  >} budget),

    above([Column(1)]) //Using 1 assuming its the first expression in your chart

))

View solution in original post

6 Replies
sunny_talwar

You can try using Column() function in place of a your dynamic label.

sunny_talwar

Or I might say 'Fred'. Try

if(

    Sum ({<financial_year={'$(=selected_year)'}  >} budget),

    rangesum(Sum ({<financial_year={'$(=selected_year)'}  >} budget),

    above([Column(1)]) //Using 1 assuming its the first expression in your chart

))

cesaraccardi
Specialist
Specialist

Hi Foldy,

I think you might be able to replace

above("Fred")

by

above(Column(X))

Where X is the position of the expression: Expression 1 = 1, Expression 2 = 2, etc... The only issue I see with this is that if you are using conditionally enabled expressions it might not work properly.

Cesar

rubenmarin

Hi Foldy, if you only have one expression maybe it works using "Column(1)" instead of column name:

if(

     Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     rangesum(Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     above(Column(1))

))

This is doing: If there is a budget for this ¿month? (the month in dimension), add this budget value to the column value in the previous row.

Maybe this option also works:

if(

     Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     rangesum(Sum ({<financial_year={'$(=selected_year)'}  >} budget),

     above("$(=selected_year)")

))

Not applicable
Author

Thanks chaps. Works a treat. Sunindia got in there first but everyone has helpful answers.

Not applicable
Author

Thanks for the extra explanation Ruben. You've made it clearer for me.