Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I am trying to get the count of incidents using the firstsortedvalue. I have filters for Category and the date. Below is the sample data.
Also, I can not have this at the script as the filters are dynamic.
ID | Group ID | Incident Grade | Incident Time | Incident ID | Incident Date | Incident Date Value | Category |
1 | 80364476 | A | 00:00:00 | 95023049 | 41523 | 9/6/2013 | Public |
2 | 80364476 | A | 12:24:39 | 95748468 | 41564 | 10/17/2013 | Public |
3 | 80364476 | A | 00:00:00 | 98735114 | 41733 | 4/4/2014 | Private |
4 | 80364476 | A+ | 00:00:16 | 104266044 | 41960 | 11/17/2014 | Public |
5 | 80364476 | A+ | 00:00:18 | 107288827 | 42118 | 4/24/2015 | Private |
6 | 80364476 | A+ | 00:00:31 | 108508060 | 42327 | 11/19/2015 | Private |
7 | 80364487 | B | 00:00:00 | 95023184 | 41646 | 1/7/2014 | Public |
8 | 80364487 | C | 12:24:39 | 95748603 | 41687 | 2/17/2014 | Public |
9 | 80364487 | C | 00:00:00 | 98735249 | 41856 | 8/5/2014 | Private |
10 | 80364487 | B | 00:00:16 | 104266179 | 42083 | 3/20/2015 | Public |
11 | 80364487 | B | 00:00:18 | 107288962 | 42241 | 8/25/2015 | Private |
12 | 80364487 | C | 00:00:31 | 108508195 | 42450 | 12/1/2015 | Private |
If I select Public and date '12/31/2014' I should see
80364476 | A+ | 104266044 | 11/17/2014 | Public |
80364487 | C | 95748603 | 2/17/2014 | Public |
If I select just the date '12/31/2014' and nothing from the Category, then
80364476 | A+ | 104266044 | 11/17/2014 | Public |
80364487 | C | 98735249 | 8/5/2014 | Private |
Thanks for all the help.
See if the attached is helpful
HI,
You are saying you select the date '12/31/2014' and you want as a result dates 11/17/2014, 2/17/2014 or 8/5/2014.
How are you matching those dates?
Please give more details.
Get the most recent one. So, in this case incident date less than 12/31/2014.
Would you be able to share the sample you might be working and testing on? I was wondering how are you making selection in your date field.
Using a variable for the date. Will try to upload a sample QVW.
Thanks
and why do you get two lines of results? Is it your need?
You don't have to use firstsortedvalue for your need.
You should just sort your table on the Incident Date field "sort by numeric value descending" and in Dimension limits you check "Restrict which values are displayed using the first expression" -> Show only -> First -> 2
Check out the attached:
No selection in Category and Date = 12/31/2014
Category = Public and Date = 12/31/2014
Thanks so much for the reply. I am trying to get the count by the Incident grade (have some others like region etc). In the below case, I need to see
Incident Grade | Count |
A | 1 |
C | 1 |
Not sure, are we talking about the same requirement as above? or the requirement changed?
Sorry for the confusion. I used your code to get the count by grade (a different report).
Thanks