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

Forecast Line Chart

hi, 

im very new to QV so all help appreciated.  Im trying to create a line chart to forecast the amount of participants in a study over the next few months.  the dimension of the chart is monthyear, and im trying to create this trendline in the LOAD script.  i have a total amount of participants that is the maximum amount of participants that can take part in the study,  and i have the total participants to date.  So what i need the script to do is estimate how many participants will be joining each month, based on the average, until we reach our full capacity.

e.g. vTotalParticipants = 100, and 50 people have joined over the last 5 months, average = 10. so next month i want 60 to be plotted on the chart, followed by 70, etc. until 100 has been met. ive started with the below script but not entirely sure im on the correct path, does anyone have any ideas to assist? 

LET vTotalAmount = sum[AMOUNT];
LET vTotalParticipants = TOTAL_PARTICIPANTS;

for each PARTICIPANT_ID in ParticipantTable

do while vTotalAmount < vTotalParticipants
vTotalAmount = vTotalAmount + avg[AMOUNT];
LOOP

NEXT

TIA

Labels (3)
0 Replies