Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
indio99
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 (2)
1 Reply
Chirantha
Support
Support

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. For example, 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

Please refer to this other post with a similar question for more information