Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

Month on Month?

untitled.bmp

Hi,

I need to generate a table that consist of two years data, YOY comparison and  MOM comparison.

My dimension is Month so it will tabulate monthly data for two years

Basicially I solved my YOY by using column 1 and 2 (2011 and 2012)

However, I am stuck in MOM as I have no idea to ask Qlikview to use Month minus Month-1 data

Any gurus can help on this?

is there such a thing of Column(2) - Column(1)-1?

Labels (1)
14 Replies
Not applicable

Hi,

Do you mean month vs last month comparison?

Regards,

Janzen

n1ef5ng1
Creator
Creator
Author

Yes,

Therefore my MOM , ie March value will be March minus Feb, April value will be April minus March

n1ef5ng1
Creator
Creator
Author

((sum({$<Year = {$(v_ThisYear)},Month = , Loading = {'ID*'}>} TEU) ))))

This is my code to find 2012 expression, month is my dimension

Thinking of using current month minus previous month,

((sum({$<Year = {$(v_ThisYear)},Month = , Loading = {'ID*'}>} TEU) ))))

-

((sum({$<Year = {$(v_ThisYear)},Month = , Loading = {'ID*'}>} TEU) ))))   ---> how do i derive previous month


Not applicable

Hi,

If its based on current month you can use this as basis..

For current month:

sum({<Month = ("$(=max(Month))")>}value)

For last month:

sum({<Month = ("$(=max(Month)-1)")>}value)

You can now have MOM change

Regards,

Janzen

n1ef5ng1
Creator
Creator
Author

Thanks for the reply

However, it is suppose to show 24months data comparison.

March 2011               Value Mar 2011-Feb 2011

April 2011                    April 2011 - Mar 2011

May 2011                    .

June 2011                    .

.

.

.Dec 2011                   

Jan 2012                    Jan 2012-Dec2011

.

.

Dec 2012

Not applicable

Hi,

You should put a value for month like this

Pass the value of month to a variable

v_ThisMonth = max({<Year = {$(v_ThisYear)} >} Month)

current month and year:

((sum({$<Year = {$(v_ThisYear)},Month = {$(v_ThisMonth)}, Loading = {'ID*'}>} TEU) ))))

current month last year:

((sum({$<Year = {$(v_LastYear)},Month = {$(v_ThisMonth)}, Loading = {'ID*'}>} TEU) ))))

Regards,

Janzen

n1ef5ng1
Creator
Creator
Author

Hi,

Tried but diden work out. However this code will only provide the month data?

Is that the comparison data value?

Not applicable

Hi,

Could you attach a sample file?

Regards,

Janzen

n1ef5ng1
Creator
Creator
Author

I will try to attach a sample file.meanwhile I am usinng if else statement to derive MOM

=if(Month = 'Feb',

(sum({$<Year = {$(v_ThisYear)},Month={'Feb'}, Unlocode_Port_Of_Loading = {'ID*'}>} TEU)
-
sum({$<Year = {$(v_ThisYear)},Month={'Jan'},Unlocode_Port_Of_Loading = {'ID*'}>} TEU)),
 
if(Month = 'Mar',
 
(sum({$<Year = {$(v_ThisYear)},Month={'Mar'}, Unlocode_Port_Of_Loading = {'ID*'}>} TEU)
-
sum({$<Year = {$(v_ThisYear)},Month={'Feb'},Unlocode_Port_Of_Loading = {'ID*'}>} TEU))
 
))

However, it is not working