Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal will move to Qlik Community Oct 4. Temporary case outage Oct 3. READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between months on a chart

I am trying to calculate the

1.  difference from previous month

2. difference of each month from last year, rolling month. for example if we are in june, then each month since june of 2011.

I have a chart showing 12 months info. I am using

Dimension:

=

if(pd.ReportMonth<=vReportMonth And pd.ReportMonth>=Addmonths(vReportMonth,-11),Date(pd.ReportMonth,'MMM YYYY'))

Any idea or suggestion

See my sample chart:

CaptureMonths.JPG

1 Solution

Accepted Solutions
Not applicable
Author

I figured this out. I still used the dimension from above and for expression for the % difference from previous month i used :

column(4)-Before(TOTAL Column(4))

and to get difference from from rolling 12 month i.e

column(4)-First(TOTAL Column(4))

View solution in original post

8 Replies
Not applicable
Author

in my opinion... this way not:)

try to change dimension from MonthYear to Month

and change the all the expression (set the year by set analysis)

then you can make an expression to calculate diff month last year

for calculating diff to prev month - check above() function

Not applicable
Author

Pari Pari, can you please provide more info on how to change the expression (set the year by set analysis)

in my expression of % PD of NTK Premium(which is what am trying to find the difference from previous month) I am using PD NTK Premium/PD Premium which is the same as----- sum({$<c.ReportMonth=>} (pd.NTK) / sum({$c.ReportMonth=>}(pd.Submit)

My dimension is

if(pd.ReportMonth<=vReportMonth And pd.ReportMonth>=Addmonths(vReportMonth,-11),Date(pd.ReportMonth,'MMM YYYY'))

Not applicable
Author

it'l be easier if you post sample qvw file;)

Not applicable
Author

Formulas:

PD premium = total of PD Premium of all branches

PD NTK Premium= total of NTK

% PD NTK of PD Prem = NTK / PD Premium

PD NTK% Difference from Previous Month= is what am trying to
find

Ignore month Only

I’ve attached a file sample

nstefaniuk
Creator III
Creator III

You can use Above if you want to use only data displayed in graph.

Else you can do that with a combination of Aggr and Above (but that's tricky).

Usually I solve this issue with a good model : http://community.qlik.com/message/229267#229267

Not applicable
Author

try this way :

Not applicable
Author

It is close. Is there not a way not not to hard code the year in. It is monthly across, so what if Ithere is october 2011 thru September 2012. where you hard coded the year for PD premium and PD NTK Premium, would not work?. Also the difference am looking for first is what is the difference of % PD NTK of PD premium from last month...

Not applicable
Author

I figured this out. I still used the dimension from above and for expression for the % difference from previous month i used :

column(4)-Before(TOTAL Column(4))

and to get difference from from rolling 12 month i.e

column(4)-First(TOTAL Column(4))

View solution in original post