Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Forecasting

Hi

I have a table as below

MonthYearReferralsDischargesExtra Patients
Apr-1165860850
May-11825715110
Jun-1186680957
Jul-11564569-5
Aug-11660690-30
Sep-1168662264
Oct-1161958930
Nov-1153348746
Dec-1137134130
Jan-1248039981
Feb-1250348122
Mar-1251947742
Apr-12523537-14
May-1238932267
Jun-1212511015

For the referrals column, how can I calcualte in Qlikview a percentage increase/decrease for each month?

Cheers

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Assuming that your table is the staright table, and it is always sorted by month, add this expression:
(sum(Referrals) - above(sum(Referrals))) / above(sum(Referrals))

And, don't forget to format it as %.

Regards,
Michael

View solution in original post

13 Replies
whiteline
Master II
Master II

If you already have month aggregated data and you want to calculate it in a table then something like this:

=Referrals/above(Referrals)

Anonymous
Not applicable
Author

Assuming that your table is the staright table, and it is always sorted by month, add this expression:
(sum(Referrals) - above(sum(Referrals))) / above(sum(Referrals))

And, don't forget to format it as %.

Regards,
Michael

Anonymous
Not applicable
Author

How about something like this:

IF(RowNo()=1,0,(SUM(Referrals)/ABOVE(SUM(Referrals))-1))

Anonymous
Not applicable
Author

Aaron,

Adding condition for the 1st row makes sense.  Although I'd probably use text 'N/A' instead of '0'. 

Regards,

Michael

Not applicable
Author

THank you for all your quick responses,

However it does not seem to work. I keep getting a '-'.

My referrals column is created by counting the number of clients I have.

If I just do an expression with Referrals to check that it work I get the right answer, but if I do above(Referrals) I get the '-'

Any ideas

Cheers

whiteline
Master II
Master II

you should use your expression for Referals inside above()

Not applicable
Author

Hi,

I worked out why its not working. It was due to the way I was handling my dates. Not sure why that was affecting it though and would love some advice on how to deal with dates.

I have the referral date which I need to group by month and year.

I dont want to group the date on load but for this table I would like the dates grouped.

Date

(DateReceived_Value, 'MMM-YY') as MonthYear

I use this code on load, and I thought the table would automactialy group all the same, but it still displays a row for every line. Any help would be great.

Cheers

Anonymous
Not applicable
Author

date(monthstart(DateReceived_Value), 'MMM-YY') as MonthYear

whiteline
Master II
Master II

The expression

Date(DateReceived_Value, 'MMM-YY') as MonthYear

Changes only a text representation (format) of DateReceived_Value. While QlikView distinguishes them by numeric values. You should also discard the days, for example as Michael suggested above.