Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Percentage comparison between months

Hi, please help me. I have this table and I need to compare amount of sales between months in percentage and then I need to make a chart from it. How can I do that?

PERIODSALES
201601256
201602263
201603486
201604156
201605848
201606564
201607452
201608489
201609856
201610485
201611523
201612875
1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Sum(SALES)/Above(Sum(SALES)) - 1

Update: Missed a closing parenthesis which I have added not in red

View solution in original post

6 Replies
lakshmikandh
Specialist II
Specialist II

sum(SALES) / sum( Total SALES)

Not applicable
Author

I´m sorry, I have not expressed myself clearly. I need to show the percentage growth between months. Can you help me?

sunny_talwar

May be like this:

Sum(SALES)/Above(Sum(SALES)) - 1

Update: Missed a closing parenthesis which I have added not in red

annafuksa1
Creator III
Creator III

Sum(SALES)/Above(Sum(SALES)

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can create a calendar like :

LOAD Date#(PERIOD, 'YYYYMM') as _PERIOD, SALES INLINE [

    PERIOD, SALES

    201601, 256

    201602, 263

    201603, 486

    201604, 156

    201605, 848

    201606, 564

    201607, 452

    201608, 489

    201609, 856

    201610, 485

    201611, 523

    201612, 875

];

SET vMinDate = 201601;

SET vMaxDate = 201612;

CAL:

LOAD

  Date#($(vMinDate)+RecNo()-1, 'YYYYMM') as _PERIOD,

  Date#($(vMinDate)+RecNo()-1, 'YYYYMM') as PERIOD,

  'M' as TYPE

AutoGenerate ($(vMaxDate)-$(vMinDate)+1)

;

Concatenate(CAL)

LOAD

  Date(AddMonths(Date#(_PERIOD, 'YYYYMM'), -1), 'YYYYMM') as _PERIOD,

  PERIOD,

  'M1' as TYPE

Resident CAL

;

And this expression :

Sum({<TYPE={'M'}>}SALES)

/ Sum({<TYPE={'M1'}>} SALES)

Help users find answers! Don't forget to mark a solution that worked for you!
Not applicable
Author

Thank you very much, it works!