Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
haribabugv
Creator
Creator

How to calculate Growth rate in Qlikview.

I have used this expression to calaculate Growth rate. But i am not getting any answer in the text box.

=num(((Sum({<[YYYYQQ]={$(=(vCurrentQuarter))}>}[Quantity])-Sum({<[YYYYQQ]={$(=(vPreviousYearQuarter))}>}[Quantity])))/(Sum({<[YYYYQQ]={$(=(vCurrentQuarter))}>}[Quantity])),'##0%' )

I have defined the above variables

Is there anything wrong in the expression?

 

YYYYMMFinancial YearMonthQuarterYYYYQQQuantity
2014112015NovQ12015Q1100
2014122015DecQ12015Q1304
2015012015JanQ12015Q1564
2015022015FebQ22015Q2345
2015032015MarQ22015Q2356
2015042015AprQ22015Q2356
2015052015MayQ32015Q3353
2015062015JunQ32015Q3325
2015072015JulQ32015Q3335
1 Solution

Accepted Solutions
sunny_talwar

I suggest using YYYYMM field to do the manipulation rather then using the YYYYQQ. But before using YYYYMM, make sure it is formatted a date rather than a number.

Script:

Table:

LOAD Date(MonthStart(Date#(YYYYMM, 'YYYYMM')), 'YYYYMM') as YYYYMM,

    [Financial Year],

    Month,

    Quarter,

    YYYYQQ,

    Quantity

FROM

[https://community.qlik.com/thread/217769]

(html, codepage is 1252, embedded labels, table is @1);

Expression:

=Num(((

Sum({<[YYYYMM]={$(=Date(Max(YYYYMM), 'YYYYMM'))}>}[Quantity])-

Sum({<[YYYYMM]={$(=Date(AddMonths(Max(YYYYMM), -3), 'YYYYMM'))}>}[Quantity])))

/

(Sum({<[YYYYMM]={$(=Date(Max(YYYYMM), 'YYYYMM'))}>}[Quantity])),'##0%')

Capture.PNG

View solution in original post

2 Replies
sunny_talwar

I suggest using YYYYMM field to do the manipulation rather then using the YYYYQQ. But before using YYYYMM, make sure it is formatted a date rather than a number.

Script:

Table:

LOAD Date(MonthStart(Date#(YYYYMM, 'YYYYMM')), 'YYYYMM') as YYYYMM,

    [Financial Year],

    Month,

    Quarter,

    YYYYQQ,

    Quantity

FROM

[https://community.qlik.com/thread/217769]

(html, codepage is 1252, embedded labels, table is @1);

Expression:

=Num(((

Sum({<[YYYYMM]={$(=Date(Max(YYYYMM), 'YYYYMM'))}>}[Quantity])-

Sum({<[YYYYMM]={$(=Date(AddMonths(Max(YYYYMM), -3), 'YYYYMM'))}>}[Quantity])))

/

(Sum({<[YYYYMM]={$(=Date(Max(YYYYMM), 'YYYYMM'))}>}[Quantity])),'##0%')

Capture.PNG

haribabugv
Creator
Creator
Author

Hey Sunny,

Thanks for your help.

I am now able to do it.