8 Replies Latest reply on Mar 27, 2017 6:03 AM by Luciano Vasconcelos

# Calculate the difference between 2 different dates

Hi,

I am trying to calculate the difference for 2 different dates(today and yesterday).

I have tried using table calculation with "Difference From , Table(Down) and Previous) i.e., ZN(SUM([B])) - LOOKUP(ZN(SUM([B])), -1)

but i am not getting correct values.

Below is the snapshot, where i am trying to calculate the difference for 2 columns i.e., test1 and test2.

Please let me know the solution for this.

Swetha

• ###### 1. Re: Calculate the difference between 2 different dates

Try doing this :   {fixed Locs : sum([test1]) - sum([test2]) } . This will work.. !!

Hi.

Hi

• ###### 4. Re: Calculate the difference between 2 different dates

Hey Swetha,

Try table(across)

• ###### 5. Re: Calculate the difference between 2 different dates

Hi Swetha,

Try the below code and let us know if it works

{FIXED [Locs]:SUM([Test2])}-{FIXED [Locs]:SUM([Test1])}

• ###### 6. Re: Calculate the difference between 2 different dates

Hi Praveen,

I tried to use this calculation but i am not getting the solution as expected.

This is how i am getting, it is getting calculated to each and every row.

Instead it should get calculated only w.r.t that particular city.

Regards,

Swetha

• ###### 7. Re: Calculate the difference between 2 different dates

Hi Swetha,

Please find the below screenshot if this is what you are looking for