Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.