# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted Not applicable

## Formula to calculate number of rows occurring in same month on a bar chart?

That title is a bit janky but I wasn't sure how to put it.

Basically I'm trying to do a graph for repairs done by a contractor, and the basic layout for the data is something like

Repair Ref No || Start Date || End Date || Repair Type

I'm planning to plot the graph against the end date as that calendar is already on there (I'm working on adding to pre-made work) but could  make a calendar for the start date (And probably will because it makes no sense)

I basically want a count for each month of the number of repairs completed in that month that were started in the same month.

I tried something like

 =if(Month(Start Date) = Month(End Date), sum(Repair Ref No))

But no data displayed when I attempted this.

Any ideas? Am I using the wrong type of graph perhaps?

Any help would greatly appreciated.

Tags (2)
1 Solution

Accepted Solutions MVP

## Re: Formula to calculate number of rows occurring in same month on a bar chart?

Maybe a Count() with an embedded condition will do:

=Count(If(Month([Start Date]) = Month([End Date]), [Repair Ref No]))

3 Replies Not applicable

## Re: Formula to calculate number of rows occurring in same month on a bar chart?

Can't find an edit button, but the formula I tried should read "count" not "sum" obviously MVP

## Re: Formula to calculate number of rows occurring in same month on a bar chart?

Maybe a Count() with an embedded condition will do:

=Count(If(Month([Start Date]) = Month([End Date]), [Repair Ref No])) Not applicable

## Re: Formula to calculate number of rows occurring in same month on a bar chart?

Worked a treat mate. Was kinda obvious but was having a complete mental block. Thanks 