5 Replies Latest reply: Jun 5, 2009 12:49 PM by Martijn ter Schegget

# Comparing dates with set analysis

Hi

My problem is the different time dimensions which have to "work together" in the chart. There is also a third time dimension, which isn't related into the data structure.That could also be a variable.

Example:

Sum (if (A_MonthID = MonthID, A_Sum))
/
Sum(if (B_MonthID = MonthID, B_Sum))

This example works just fine with normal If-clause. The solution is - however - very heavy when there are 10 millions of rows and some other if-conditions in the both clauses. (And in the future the chart should actually show bars on every day on the selected month.)

Because of that I would like to use the SET-analysis. I don't know if it's possible. It would work easily if you have just one time dimension but this case is different.

Any ideas or code-examples?

-Marcus

• ###### Comparing dates with set analysis

Hi Markus,

Rainer

• ###### Comparing dates with set analysis

Ok. This solution works fine in this case. The table structure in the real case I'm working with is much more complicated and it's not possible use the date field as a Key field.

Thanks anyway .

• ###### Comparing dates with set analysis

Markus,

see the next example. It will hopfully show a direction to develop your script.

Rainer

• ###### Comparing dates with set analysis

Hi Rainer

This structure looks very good and might give me some answers. I've bumped into many problems with time dimensions and I really need better solutions in the future. This seems to work excellent.

Thanks.

-Markus

• ###### Comparing dates with set analysis

Hi Markus,

You might also want to take a look at Oleg's wiki article about using flags; the example he mentions (some kind of 'same month last year' calculation) looks a lot like your case.

With regards,

Martijn