Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
wezza2
Contributor
Contributor

Above function help - chart function

Hello I am fairly new to qlik, so maybe there’s a way to do this which I don’t understand. I am using the Above() function nested in RangeSum() which essentially gives me the sum of an array. However, I would the 3rd parameter, count, to be dynamic - change accounting to the number of dates available for a particular year. Can someone please help me with this? Thanks

Labels (1)
1 Reply
cristianj23a
Partner - Creator III
Partner - Creator III

Hi, You can utilize the Count function to dynamically change the range for the Above() function based on the number of dates available for a particular year.

Here's an example of how you might use this:

RangeSum(Above(Sum(Value), 0, Count(DISTINCT DateField)))

In this example, DateField would be the name of the field containing your dates. The Above() function will then look at the range above the current row, up to the number of distinct dates you have.

If you need to filter this specifically by a year, you could modify this to include a set analysis within the Count function:

RangeSum(Above(Sum(Value), 0, Count({<YearField={$(=Year(Today()))}>} DISTINCT DateField)))

Here, YearField would be the name of the field containing the year value, and Year(Today()) would evaluate to the current year. You would adjust this expression to filter based on the specific year you are interested in.

Remember to replace Value, DateField, and YearField with your actual field names.

Regarts.

 

 

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.