2 Replies Latest reply on Jun 23, 2016 1:26 AM by Aym cham

# compare multiple rows and return value

Hi all,

I have this:

 row Date Name Value 1 1/01/2016 test1 1 2 1/01/2016 test1 1 3 2/01/2016 test1 5 4 2/01/2016 test1 5 5 1/01/2016 test2 20 6 2/01/2016 test2 25 7 2/01/2016 test2 25 8 1/01/2016 test3 10 9 2/01/2016 test3 15

I want to compare this table row by row.

first case:

if date of row 1 = date of row2 and name of row 1 = name of row 2 then return average value

second case:

if date of row 1 != date of row2 or name of row 1 != name of row 2 then return sum value

in this case, I would like to print this, in tableau:

 Name Value test1 6 test2 45 test3 25

How can i do this please?

Aym

• ###### 1. Re: compare multiple rows and return value

Hi Aym,

I would solve your issue using an LOD calculation that averages on level name and date. then Sum those values on Name level.

Formula would look like this:

{FIXED [Date], [Name]: AVG([Value])}

With [Name] rows you simply Sum() the above field.

Hope this helps.

Kind regards,

Justus

InterWorks

• ###### 2. Re: compare multiple rows and return value

Perfect,

Thanks a lot Justus.

Aym.