Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
srinivasa1
Creator II
Creator II

sales diffrence calc for month and previous month

Hi,

i have a field year contains 2011,2012,2013 and month filter jan,feb,mar etc

i need to calculate the difference sales between current selected year  month and previous month.(ie)

if i selected year 2011 then  feb month then the result should find difference between jan and feb.....

pls,help me out thanks in advance.

30 Replies
Anonymous
Not applicable

sum({$<Year={$(=max(Year))},Month={$(=month(addmonths(max(InvoiceDate),0)))}>}Sales)

-

sum({$<Year={$(=max(Year))},Month={$(=month(addmonths(max(InvoiceDate),-1)))}>}Sales)

substitute "InvoiceDate" for equivalent date value

srinivasa1
Creator II
Creator II
Author

Hi,

Thanks for your reply.i have tried but it shows only for max year by default i would like to show diffrance for all the year.

I have attached my sample app

thanks in advance

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the application, hope this is what you want.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable

I liked Kaushik's approach. I modified it slightly but I think either illustrates the core of the idea in using the before() and after() functions.

srinivasa1
Creator II
Creator II
Author

Thanks.

I like go with before option

But same time jan cols I need to hide as its coming as
zero.or otherwise month dim should be look  (jan-feb) instead of jan,feb as its now
showing

And also let me know is any other approach handle this by  writing set analysis or if condition

srinivasa1
Creator II
Creator II
Author

Thanks.

I like go with before option

But same time jan cols I need to hide as its coming as
zero.or otherwise month dim should be look  (jan-feb) instead of jan,feb as its now
showing

And also let me know is any other approach handle this by  writing set analysis or if condition

Anonymous
Not applicable

Sorry. But I don't understand what you are asking.

srinivasa1
Creator II
Creator II
Author

Hi ,

I mean How i can handle  month on month diffrance for mutiple year selection by useing setanalysis insted of before function

thanks in advance

Anonymous
Not applicable

Let's clarify first. This is what I'm understanding so far.

This is what we have:

YEAR2011
MONTHJANFEBMAR APRMAY JUNJULAUGSEPOCTNOVDEC
SALES-FEB - JANMAR - FEBAPR - MARMAY - APRJUN - MAYJUL - JUNAUG - JULSEP - AUGOCT - SEPNOV - OCTDEC - NOV
Selections:
YEAR2011

You've said that the scenario will be such that the field selections for YEAR will be 2011 and 2012 (for example). In that situation, you want the chart to do something different to handle the multiple selections.

What exactly do you want it to do?

i.e.

possible results:

- if 2011 and 2012, then show just 2012 (12 total values in output)

  - if 2011 and 2012, then show just 2011 (12 total values in output)

  - if 2011 and 2012, then show both 2011 and 2012; calculate month over month for each (24 total values in output)

  - if 2011 and 2012, then show cumulative difference for both years; (Mar2011+Mar2012) - (Apr2011+Apr2012) --> (12 total values in output

There are more possibilities but those were a few that quickly came to mind to offer as examples. The current set up you have will show the 3rd option with 24 values in the output. If you want something different, please describe the intended output.

srinivasa1
Creator II
Creator II
Author

Sorry to make you worry ,Thanks for your effort looking result as below

- if  i select from slider 2011
and 2012 and 2013, then 2011 and 2012 and 2013; calculate month over month diffrance

  1. Eg. If select
    2011 as Year then my month on month difference should be as below






























 

Year


 

 

2011(for 2011)


 

 

Month


 

 

Jan2011-Feb2011 Diff


 

 

Feb2011-Mar2011 Diff


 

 

Mar2011-Apr2011 diff


 

 

Apr-may diff


 

 

May-Jun


 

 

Jun-July


 

 

July-Aug


 

 

Aug-Sep


 

 

Same way Till Dec


 

 


 

 

200


 

 

200


 

 

100


 

 

50


 

 

500


 

 

250


 

 

60


 

 

600


 

 


 

Eg. If select 2012 as Year then my month on
month difference should be





























 

Year


 

 

2012(for 2012)


 

 

Month


 

 

Jan2012-Feb2012 Diff


 

 

Feb2012-Mar2012 Diff


 

 

Mar2012-Apr2012 diff


 

 

Apr-may diff


 

 

May-Jun


 

 

Jun-July


 

 

July-Aug


 

 

Aug-Sep


 

 

Same way Till Dec


 

 


 

 

200


 

 

200


 

 

100


 

 

50


 

 

500


 

 

250


 

 

60


 

 

600


 

 


 

  1. Eg. If select
    20123 as Year then my month on month difference should be





























 

Year


 

 

2013(For 2013)


 

 

Month


 

 

Jan2013-Feb2013 Diff


 

 

Feb2013-Mar2013 Diff


 

 

Mar2013-Apr2013 diff


 

 

Apr-may diff


 

 

May-Jun


 

 

Jun-July


 

 

July-Aug


 

 

Aug-Sep


 

 

Same way Till Dec


 

 


 

 

200


 

 

200


 

 

100


 

 

50


 

 

500


 

 

250


 

 

60


 

 

600


 

 


 

  1. Eg. If select
    2011,2012,2013 as Year then my month on month difference should be same as
    above in one pivot table first it will show month on month difference 2011 after
      2012 and 2013

Thanks in advance sir