Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have data like below loaded into QV, how do I write an expression that counts the number of injury in the current month i.e. Aug
I have already have an expression for the total
count({1<IncidentType={'*Injury*'}>}IncidentType)
But I now need to show the total INJURY for the current month regardless of the selection. I know its something to do with month(Today()) but what I have tried is not working.
Thanks for your help
ID | Site | DateRaised | IncidentType |
17520 | Site a | 23/07/2012 09:30 | Injury |
17609 | Site a | 24/07/2012 08:00 | Injury |
17612 | Site a | 25/07/2012 13:00 | Injury |
17614 | Site a | 25/07/2012 15:30 | Injury |
17689 | Site a | 30/07/2012 11:10 | Injury |
17867 | Site b | 01/08/2012 08:30 | Injury |
17873 | Site b | 06/08/2012 15:50 | Injury |
17874 | Site b | 06/08/2012 08:00 | Injury |
17888 | Site b | 06/08/2012 17:30 | Injury |
17962 | Site b | 09/08/2012 15:00 | Injury |
17986 | Site b | 10/08/2012 12:00 | Injury |
18008 | Site a | 10/08/2012 14:00 | Injury |
18049 | Site a | 13/08/2012 10:00 | Injury |
18076 | Site c | 15/08/2012 23:00 | Injury |
18078 | Site c | 16/08/2012 13:55 | Injury |
18193 | Site c | 23/08/2012 09:00 | Injury |
To use set analys you will need to define the months for your data in the script, probably would be best using MonthName(DateRaised) as MonthYearRaised which returns the month and year. then in set analysis you can do:
count({1<IncidentType={'*Injury*'},MonthYearRaised ={$(=Monthname(Today()))}>}IncidentType)
or if you dont want to do that you can do this:
count({1<IncidentType={'*Injury*'}>}if(Monthname(DateRaised)=Monthname(today()),
IncidentType))
To use set analys you will need to define the months for your data in the script, probably would be best using MonthName(DateRaised) as MonthYearRaised which returns the month and year. then in set analysis you can do:
count({1<IncidentType={'*Injury*'},MonthYearRaised ={$(=Monthname(Today()))}>}IncidentType)
or if you dont want to do that you can do this:
count({1<IncidentType={'*Injury*'}>}if(Monthname(DateRaised)=Monthname(today()),
IncidentType))
this works
count({1<IncidentType={'*Injury*'}>}if(Monthname(DateRaised)=Monthname(today()),
IncidentType))
Thank you