Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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

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

View solution in original post

3 Replies
Not applicable
Author

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

swuehl
MVP
MVP

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

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

Not applicable
Author

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