Bottom N Filter, need to only get one value.
Okay, a continuation of my last question,
I have a column, and what I'm needing is a min/max of a count of this column, which is grouped on another field, since its a max/min ACROSS another column.
Basically
Building Max Appts: Count(ApptId) \\grouped on the Name field below
Building Min Appts: Count(ApptId) // aka, the Doors.
...
...
Door 1 Count(ApptId) \\
Door 2 Count(ApptId) -- grouped by the Name field, which is what the "Door 1, 2 and 3" are.
Door 3 Count(ApptId) //
The Building Max/Min's are also filtered by Top N/Bottom N, which N is one to get the absolute max/mins, however, I'm having a problem where I get
Building Max : 5
Building Min: 1
Building Min: 1
Because two Doors will share the same count of appointments.
I've tried something like this
=IIF(Fields!name.Value <> Previous(Fields!name.Value, "DataSet1") And Count(Fields!ApptId.Value) = Previous(Count(Fields!ApptId.Value), "DataSet1"), " ", Count(Fields!ApptId.Value))
but this doesn't behave how it should, and by logic, it should stop the repeats, but it doesnt. Can anyone help?
May 12th, 2011 1:27pm
How about:
=IIF(Fields!name.Value = Previous(Fields!name.Value, "DataSet1") And Count(Fields!ApptId.Value) = Previous(Count(Fields!ApptId.Value), "DataSet1"), " ", Count(Fields!ApptId.Value))Kalman Toth, SQL Server & BI Training; SQL 2008
GRAND SLAM
May 13th, 2011 10:29am
How about:
=IIF(Fields!name.Value = Previous(Fields!name.Value, "DataSet1") And Count(Fields!ApptId.Value) = Previous(Count(Fields!ApptId.Value), "DataSet1"), " ", Count(Fields!ApptId.Value))
Kalman Toth, SQL Server & BI Training; SQL 2008
GRAND SLAM
I should have mentioned I tried that first, it doesnt work, and logically it doesnt make sense. I wanna check that the name's of the doors are different, and if they have the same count of appointments, then dont show that "row" in the group. Basically I
dont need multiple rows showing a "min" or "max" for the end user when there are more than one.
Filtering/visibility has not helped, or I'm not filtering correctly. Tried both
Fields!name.Value = Previous(Fields!name.Value, "DataSet1") And Count(Fields!ApptId.Value) = Previous(Count(Fields!ApptId.Value), "DataSet1") and
Fields!name.Value <> Previous(Fields!name.Value, "DataSet1") And Count(Fields!ApptId.Value) = Previous(Count(Fields!ApptId.Value), "DataSet1"),
on visibility, and filtering would work perfectly if we could use First/Last or Previous... ugh
Wow I'm an idiot, set visibility to PREVIOUS(COUNT(ApptId)) = COUNT(ApptId). Took me a month to do that... ugh. haha. Well glad that works! That was the one thing I DIDNT do.
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 10:47am