Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

tracycrown
Contributor II

Growth Rate

Dear all

Can someone help to explain why following script does not work in expression ?

   

Type2012201320142015
Sales1000150012002200
50%-20%83%

(sum(if(Type='Sales',Data))-Before(sum(if(Type='Sales',Data))))/Before(sum(if(Type='Sales',Data)))

Thank you

Tracy

4 Replies
sinanozdemir
Valued Contributor III

Re: Growth Rate

Hi Tracy,

I tried to mimic your data-set, the if statement works for me. Maybe you have extra space in the type field so try trim() function.

Sum(If(Trim(Type) = 'Sales', Data)) and here is my expression:

Capture.PNG

If that doesn't work, try set analysis with Sum({<Type={'Sales'}>} Data).

Hope this helps.

tracycrown
Contributor II

Re: Growth Rate

Dear Sinan Ozdemir

I can compute the % but nothing shown on the chart, please advise.

Thank you

Tracy

Highlighted
krishna20
Valued Contributor II

Re: Growth Rate

Hi,

Here is your output. Pls find the attached doc.

Comm_.png

Edited by : Krishna

Partner
Partner

Re: Growth Rate

Hi:

Before function works only in Pivot table not any other chart. To see the value replace before with above.

Kind Regards,

Bimala