Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total Average Forecast Value

Below I have a table with actual calls and forecasted calls (and the script below to calculate it).
In the example, I need to use the value of 8031 (total of forecast calls) in an expression similar to this one:
IF(TOTAL_FORECAST_CALLS > 5000, FORECAST_CALLS x 10)
Where TOTAL_FORECAST_CALLS = 8031 and FORECAST_CALLS = 259

DayActual CallsForecast Calls
Total41458,031
1285259
2305259
3195259
4265259
5300259
6145259
7125259
8390259
945259
10455259
11360259
12380259
13365259
14335259
15195259
160259
170259
180259
190259
200259
210259
220259
230259
240259
250259
260259
270259
280259
290259
300259
310259
2 Replies
Not applicable
Author

=avg( TOTAL Aggr(if(DAYNUMBER <= day(Today()), sum(IF(YEAR = $(vCurrentYear) AND MONTHNUMBER = $(vCurrentMonth)AND LEDGER = 'SOPCALC' ,VOLUME))),DAYNUMBER))

Not applicable
Author

I managed to resolve this using the below script:

Instead of the above forecast script i used:

sum

(total(if(DAYNUMBER<= Day(Today()),IF(YEAR = $(vCurrentYear) AND MONTHNUMBER = $(vCurrentMonth)
AND LEDGER = 'SOPCALC',VOLUME))))/ num(Day(Today()))


and then used this script to return the total of that:

sum

(total(if(DAYNUMBER<= Day(Today()), IF(YEAR = $(vCurrentYear) AND MONTHNUMBER = $(vCurrentMonth)
AND LEDGER = 'SOPCALC',VOLUME))))/ num(Day(Today()))* max(total(DAYNUMBER))