Page 1 of 2

Filter by Wildcard

PostPosted: Tue Feb 03, 2009 3:40 pm
by Telepee
A group of us are (anonymously) Benchmarking against one another - I've created a number of reports to show just our stats.

The filter I am using to restrict player name is as follows:

#Player#='Player01' OR #Player#='Player02' OR #Player#='Player03' OR #Player#='Player04' OR #Player#='Player05' OR #Player#='Player06' OR #Player#='Player07' OR #Player#='Player08' OR #Player#='Player09' OR #Player#='Player10' OR #Player#='Player11' OR #Player#='Player12' OR #Player#='Player14'

The players involved are growing and changing - I have to have the filter in each report, so every change I have to make in every report. Not too much hassle at the moment, but I expect the number of reports I have to grow dramatically as we get into this. I would much prefer to filter with a wildcard character so that I can forget about it - I'd like to replace the code above with something like....

#Player#='Player*'

The code above does not work, but hopefully you can see from it what I'm trying to do - is it possible for me to add a filter using a wildcard?

Thanks

Re: Filter by Wildcard

PostPosted: Wed Feb 04, 2009 6:13 am
by WhiteRider
I just found this out last week - you can filter like this:

#Player# LIKE 'Player%'

..which means that the player name is "Player" followed by any other characters.
If you want to do anything more specific, have a look at this page.

Re: Filter by Wildcard

PostPosted: Fri Feb 06, 2009 6:57 pm
by Telepee
That works great - ty :)

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 7:30 am
by Telepee
I'm trying to run this report:
Image

The objective is to show cumulative stats for the selected players. The result however seems to GROUP BY the selected players whilst what I'm really trying to do is show the stats WHERE the player is one of ours.

Any guidance would be appreciated.

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 11:43 am
by kraada
Well, one point is you can just use #Player# LIKE 'Player%' and get it all in one line.

I think if you use the Player stat it's going to always group on that player though; it uses the str_player_name column which has group by checked. You could duplicate that column and create a new column str_player_name_no_group (or whatever you'd prefer to call it) that isn't grouped by, then run reports using that one and it should lump everything together for you.

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 11:54 am
by Telepee
kraada wrote:Well, one point is you can just use #Player# LIKE 'Player%' and get it all in one line.


The reason I've done it that way is that there's a player in the database called Player_007 who is not a part of the group.

kraada wrote:I think if you use the Player stat it's going to always group on that player though; it uses the str_player_name column which has group by checked. You could duplicate that column and create a new column str_player_name_no_group (or whatever you'd prefer to call it) that isn't grouped by, then run reports using that one and it should lump everything together for you.


ty - I'll give that a try this weekend.

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 11:58 am
by kraada
% reads to the end of the string, not just the next character.

Player% would match: Player1, Player70, Player_x357, etc.

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 12:04 pm
by Telepee
kraada wrote:% reads to the end of the string, not just the next character.

Player% would match: Player1, Player70, Player_x357, etc.


If I use:
#Player# LIKE 'Player%'
instead of:
#Player# LIKE 'Player0%' OR #Player# LIKE 'Player1%'
then it will include Player_007. I want to exclude Player_007 and just include Player01, Player02, Player03 ... Player19

Re: Filter by Wildcard

PostPosted: Fri Feb 13, 2009 1:17 pm
by kraada
Ah, I see. And not(#Player# LIKE 'Player_%') would work too but since you only have 19 players I guess it's the same number of queries.

Re: Filter by Wildcard

PostPosted: Sat Feb 14, 2009 8:51 am
by Telepee
kraada wrote: You could duplicate that column and create a new column str_player_name_no_group (or whatever you'd prefer to call it) that isn't grouped by, then run reports using that one and it should lump everything together for you.


I'm struggling a bit with this - getting the error: "player.player_name must appear in the GROUP BY clause or be used in an aggregate function"

Image

Image