5 Replies Latest reply on Jun 28, 2012 10:29 PM by Vladislav Grigorov

# Show Month and previous Month and Difference

Hello,

I have a very stupid question...but I can't see how to do it!

I want to have a grid with three different columns and multiple rows: on each row, different variables (var1, var2, var3, etc...) and in each column I want to have:

Col1: actual month (set by a filter --> the filter must select ONLY ONE month)

Col2: previous month.

Col3: difference between them.

How can I do this easy staff?

Thanks!

Marc Freixa

• ###### 1. Re: Show Month and previous Month and Difference

That's the closest I could get by using parameter to select a date from the "current" month, and then do the math in the calculated fields.

Hope it helps!

• ###### 2. Re: Show Month and previous Month and Difference

Your example has shown me something I should work around. there's something I don't really like... how can I change the filter for one with just a list of different months? (and I don't mean to create a list manually, because it would mean to insert lots of months)...

But all the rest is quite good! And i've also improved the example with an icon that shows if the diffrence between is good (green bullet) or bad (red bullet).

Amazing!

Thanks!

M.

• ###### 3. Re: Show Month and previous Month and Difference

Hello Marc,

Could you elaborate a little bit on your idea about multiple months? If it is going to be a period of let's say 3 consecutive months, this could be done by selecting the start and end date. Tus you can get virtually any period as a startin point, if it is continuous. The question then is what are you going to compare with as "previous" period as I could see a coup of options there:

option 1)  is it going to be the same number of months prior to your period (e.g. your period is 15 May - 14 Jul, and you compare it with 15 March - 14 May), or

option 2) the same number of complete months prior to your period (e.g. your period is 15 May - 14 Jul, and you compare it with 1 March - 30 April), or

option 3) you will be counting the days in the periodd (e.g. your period is 15 March - 14 May, and you compare it with 15 January - 15 March).

I believe if we grasp the concept well, your idea is fully achievable.

• ###### 4. Re: Show Month and previous Month and Difference

Hello Marc,

Take a look at the attached file. HTH.

Basheer

• ###### 5. Re: Show Month and previous Month and Difference

Great job Basheer!

It never occured to me to use table calc for this, although now I realize it is the most straightforward way to approach the poblem. I actually tried and simplified he table calc formula to be:

ZN(WINDOW_SUM(SUM([Sales (copy)]), -1, -1)), thus taking directly the sum of sales for the previous month, and making sure it is 0 if Null fo the first record. It still worked.

Cheers!