Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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

Re: RangeSum() and Above()

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

))

6 Replies

Re: RangeSum() and Above()

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

Re: RangeSum() and Above()

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

))

Highlighted
cesaraccardi
Valued Contributor

Re: RangeSum() and Above()

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

Re: RangeSum() and Above()

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

Re: RangeSum() and Above()

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

Not applicable

Re: RangeSum() and Above()

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