Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple (?) Count

Hi

I have a bar chart that counts how many notifications that are closed for a specific month.

Count (MID([User status],1,4='CLSD'))

no problems as my dimension is set to look for completion date (month).

Here is the trick: There are still notifications in progress that I also would like to count for the same month but as long as i have completion date as dimension, I can not get this to work.

The ultimate ansver should be a comparison between the closed notifications and the total of notifications for just this month.

I have tried like this:

Date(MonthStart([Completn date]),'MMM YYYY') as Compl.month in the script

Compl.month as Dimension

One expression is Count (MID([User status],1,4='CLSD')) Actual numbers of CLSD is 15

Next expression is Count (Total(Notification)) Actual numbers of notifications is 38

My result is

2013-05-17 14-01-05.jpg

I would like the red bar to be 38 and eventually i would like to have a percentage between closed and total notifications for a specific month...

Best regards

/Mats

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Ok, based on following table, there are 13 issues closed in Jan that have been created in Jan and 2 issues have been created only (not closed) --> TOTAL 15.

NotificationUser statusCompletn dateNotif.date
10766767CLSD15.01.201308.01.2013
10770184CLSD15.01.201314.01.2013
10770186CLSD15.01.201314.01.2013
10770406CLSD21.01.201315.01.2013
10773467CLSD21.01.201321.01.2013
10770017CLSD22.01.201314.01.2013
10774250CLSD22.01.201322.01.2013
10775196CLSD23.01.201323.01.2013
10776631CLSD29.01.201325.01.2013
10778208CLSD30.01.201328.01.2013
10774219CLSD31.01.201322.01.2013
10774216CLSD31.01.201322.01.2013
10778654CLSD31.01.201329.01.2013
10778343CLSD05.02.201328.01.2013
10766179CLSD08.02.201307.01.2013
10778204CLSD08.02.201328.01.2013
10779286CLSD08.02.201330.01.2013
10778340CLSD20.04.201328.01.2013
10766178IPRG
07.01.2013
10771399IPRG
17.01.2013

Based on this table, there are 18 issues closed in Feb, that have been created in Feb and additional 5 issues have been created but not closed --> Total 23.

You are again losing 5 issues that have been closed in a later month.

NotificationUser statusCompletn dateNotif.date
10782636CLSD04.02.201304.02.2013
10782638CLSD04.02.201304.02.2013
10782624CLSD04.02.201304.02.2013
10782622CLSD04.02.201304.02.2013
10782857CLSD08.02.201305.02.2013
10786835CLSD11.02.201311.02.2013
10786837CLSD11.02.201311.02.2013
10784637CLSD18.02.201307.02.2013
10791902CLSD19.02.201319.02.2013
10792143CLSD19.02.201319.02.2013
10792111CLSD19.02.201319.02.2013
10792142CLSD19.02.201319.02.2013
10792826CLSD19.02.201319.02.2013
10786963CLSD20.02.201312.02.2013
10791282CLSD20.02.201318.02.2013
10792106CLSD20.02.201319.02.2013
10792102CLSD21.02.201319.02.2013
10796210CLSD26.02.201325.02.2013
10792145CLSD13.03.201319.02.2013
10786804CLSD19.03.201311.02.2013
10792110CLSD24.04.201319.02.2013
10791269CLSD25.04.201318.02.2013
10791884CLSD25.04.201319.02.2013
10793616IPRG
20.02.2013
10793621IPRG
20.02.2013
10794052IPRG
21.02.2013
10794352IPRG
21.02.2013
10794844IPRG
22.02.2013

Seems to me that this is what you want to see:

Instead grouping by Completion month, you need to group by Notif. month (reason: there is no Completion date for User status IPRG, that you will need to account for in your total issue number for that month).

Then look for the issues that were closed in the same month than created:

=count( distinct {<Notification = {"=[Notif month]=[Completn month]"}, [User status] = {CLSD} >}  Notification)

and count the number of IPRG status for that month:

=count({<[User status] = {IPRG}>} Notification)

adding the two gives you the total (23 for Feb).

I haven't understood how you want to calculate the percentage from the difference, but that should be easy for you.

View solution in original post

12 Replies
swuehl
MVP
MVP

I believe your request is similar to this one: http://community.qlik.com/message/342059#342059

so please have a look at the proposed solution over there.

Please also recheck your expression:

MID([User status],1,4='CLSD')

I believe you want to compare the string returned from MID, not 4 with a string?

Mid([User status],1,4) = 'CLSD'

Then, to prevent to count matching as well as not matching [User status] values, you should use something like

if(Mid([User status],1,4) = 'CLSD', [User status])

with an implicite NULL for not matching entries.

--> count( if(Mid([User status],1,4) = 'CLSD', [User status]) )

Not applicable
Author

Hi

Thanks for your answer but it's not really what i had in mind.

Please look at the attached files.

Dimension is Compl.date (jan-april)

On one bar i would like to have the number of closed (CLSD) notifications (15, 23, 71, 38) and on an other bar i would like to have the total (CLSD+IPRG) of notifications for that specific month (41, 49, 97, 64).

My final composition should be the difference between number of closed notifications and the total number of notifications in percent (Notification Gap for each month), based on Compl.date.

Best regards

/Mats

swuehl
MVP
MVP

Sorry, I don't get how you calculate the total number for a month, for example 41 for jan, taken your sample xlsx.

Not applicable
Author

Hi

If I filter the Completn date with January+blanks I get all notifications for that month, CLSD and IPRG, 41 in total.

/Mats

swuehl
MVP
MVP

I only get 41 records for Jan if I count incl.  Notifications like 10793616, which shows a Notif. date 20.02.2013, which is past Jan 2013. So you want to count all Notifications, which are not closed, but may show up in the future?

Not applicable
Author

Hi

You are right…

It should of course be the notifications with notif.date in each month that are interesting.

In this case for January its 17 created and 15 closed notifications. For February its 23 created and 18 closed.

It’s that gap in percent I am interested in.

Best regards

/Mats

swuehl
MVP
MVP

Still don't get how you calculate your numbers, I calculate

23 closed (status CLSD) and 28 total (23 + 5 with status IPRG) for month February.

Not applicable
Author

Hi

Look at the pic. 23 in total for february. 18 CLSD, 5 IPRG

2013-05-21 12-10-50.jpg

Notif.date and Completn date are both filtered for february.

/Mats

swuehl
MVP
MVP

I am getting more and more confused.

So you don't want to count the 5 issues as CLOSED for month Feb 2013, that were created in December 2012 and Jan 2013?

Please compare with your number for CLOSED issues in your second post, where you required a number of 23 (now you are telling 18).

I don't have much more time too spend on this, sorry.