3 Replies Latest reply: Apr 6, 2011 3:39 PM by cybernit

# Comparing between periods of time

Hi,

I'm dealing with working accidents database. Each accident has a date field. I want to calculate the number of accidents during a requested period of time (for example: first quarter of 2010) and then compare it to the number of accidents in the same quarter of the previous year. In fact, I want to divide those two numbers (number of accidents in current period / number of accidents in similar previous period) to see if the result is bigger than 1 or not.

Can I do this in QlikView? Can I do this for each period of time? (month,year etc.)

Thanx!

:)

• ###### AW:Comparing between periods of time

Hi,

sounds as if it could be done with QV ;)

Make a cyclic group with the kinds of periods you want to see (months, weeks, quarters...).

Summarize over time, make a second expression with the period minus 1 (with set-expression).

Whereas period stands for week, month or whatever you have chosen.

And then you can divide, for example with column(2)/column(3). So you get your value bigger or smaller than 1 :)

HTH

• ###### AW:Comparing between periods of time

I will give it a shot

Nitzan

• ###### AW:Comparing between periods of time

I tried your tip but it seems that I don't fully understand where to insert the "period - 1" statement... Do I add it to the cyclic group when I creat it (under Settings -> Document properties) or in the chart that I've added? I just can't find this set -> expression button that you described...

And another small question - you said that I can devide the results of the two periods to see if it's bigger than one or not. Can I creat a Gauge chart and connect that result to it? I mean: 1 will be the center line, above it will be the right area and below it will be the red area...

Thanx

Nitzan