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

Forcasting in Qlikview

Hi, I am new to Qlikview and have a requirement in relation to forecast and need your input/help.

The requirement is, for a Part, if the stock depletes by 20% a year from the current stock level, need to represent this using chart(graph) by month for the next 10 years.

Was able to come up with a formula to calculate this in excel, but not sure how to represent this in Qlikview.

Example Input:

Part, Stock, Rate of depletion per Year

PART A, 2000, 20%

PART B, 1000, 10%

PART C, 3000, 5%

In the above example for PART A, the stock would be

Year 1 - 2000 

Year 2 -1600 (2000- 400)

Year 3 - 1280  (1600 - 320) and so on...

Appreciate your input.

Thanks

Venkat

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Venkat,

Try:

Data:

LOAD * INLINE [

    Part, Stock, Rate of depletion per Year

    PART A, 2000, 20%

    PART B, 1000, 10%

    PART C, 3000, 5%

];

OverTime:

LOAD

Part,

IterNo() as Year,

Stock*(pow(1-[Rate of depletion per Year],(IterNo()-1))) as Inventory

Resident Data

While IterNo()<=10;

Kind regards

Andrew

View solution in original post

6 Replies
effinty2112
Master
Master

Hi Venkat,

Try:

Data:

LOAD * INLINE [

    Part, Stock, Rate of depletion per Year

    PART A, 2000, 20%

    PART B, 1000, 10%

    PART C, 3000, 5%

];

OverTime:

LOAD

Part,

IterNo() as Year,

Stock*(pow(1-[Rate of depletion per Year],(IterNo()-1))) as Inventory

Resident Data

While IterNo()<=10;

Kind regards

Andrew

effinty2112
Master
Master

Hi Venkat,

If you would prefer to do this in the UI then use a calculated dimension

=ValueLoop(1,10)

labelled Year in the table below

with the expression

Stock*(pow(1-[Rate of depletion per Year],(ValueLoop(1,10)-1)))

To get

Year Part PART APART BPART C
1 200010003000
2 16009002850
3 12808102707.5
4 10247292572.125
5 819.2656.12443.51875
6 655.36590.492321.3428125
7 524.288531.4412205.275671875
8 419.4304478.29692095.0118882812
9 335.54432430.467211990.2612938672
10 268.435456387.4204891890.7482291738

Regards

Andrew

Not applicable
Author

Thanks Andrew, The solution you have proposed worked.Appreciate your help.

If I need to calculate stock depletion by month, if the rate of depletion is 20% per year, What would be the formula, I need to use? Thanks

Not applicable
Author

Was able to get it Andrew. Thanks

OverTime:

LOAD

Part,

Date(AddMonths(Today(), IterNo()), 'MM-YYYY') as Month,

Stock*(pow(1-[Rate of depletion per Year],(IterNo()-1)/12)) as Inventory

Resident Data

While IterNo()<=120;

effinty2112
Master
Master

Hi Venkat,

Glad you've got the result you need. Please close the thread if there's nothing else i can do for you.

Regards

Andrew

Not applicable
Author

Thanks Andrew