Filter by Wildcard

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Re: Filter by Wildcard

Postby WhiteRider » Sat Feb 14, 2009 9:32 am

I think you need the 'group by' field checked - otherwise you will get multiple rows per player.
Can you post an image of your original report to show what the problem is?
Are you saying that you get one row for all the players combined?
Have you added the Player stat to the report? If you do that you should get a single row for each player.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Filter by Wildcard

Postby Telepee » Sat Feb 14, 2009 9:59 am

I'll show examples the reports that I originally ran (and why they are or are not what I am after).

In this first report, the filter is:
#Player# LIKE 'Player0%' OR #Player# LIKE 'Player1%'

Image

That's fine and pretty much as wanted.

Next I want the same information subtotaled by position, for just these players, but not grouped by these players. So I remove Player from the Report stats, but leave player in the filter, but get the same report (just without player names)..

Image

So instead if I try putting the filter in by the new stat - I replace:
#Player# LIKE 'Player0%' OR #Player# LIKE 'Player1%'
with
str_player_name_no_group LIKE 'Player0%' OR str_player_name_no_group LIKE 'Player1%'

That then gives me the error message you saw in my previous post:

Image
Telepee
 
Posts: 23
Joined: Fri May 16, 2008 10:58 am

Re: Filter by Wildcard

Postby WhiteRider » Sat Feb 14, 2009 10:17 am

I'm not sure that you'll be able to do what you want (players' stats may always be kept separate) but it might be.
However, I think that rather than removing 'group by' from the Player stat, you need to go the other way and create duplicates for the other stats which are 'group by'.
You could try it by creating new Position and VP$IP stats (and removing PFR and BB/100 to start with) and setting your new columns to be 'group by'.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Filter by Wildcard

Postby Telepee » Sat Mar 14, 2009 12:09 pm

WhiteRider wrote:I'm not sure that you'll be able to do what you want (players' stats may always be kept separate) but it might be.
However, I think that rather than removing 'group by' from the Player stat, you need to go the other way and create duplicates for the other stats which are 'group by'.
You could try it by creating new Position and VP$IP stats (and removing PFR and BB/100 to start with) and setting your new columns to be 'group by'.


I have to confess, I didn't perservere with this - instead getting the data into Excel and manipulating it as needed there.


kraada wrote: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.


I have decided to rebuild my database (due to some data management issues) which I've just completed. Rebuilding the database allowed me to learn from the earlier experiences, and I've made a number of improvements. One of the improvements was to make the anonymous player names a bit more unique - to reduce the filter (as you originally suggested). So instead of Player01, Player02, ... Player19, I now have PunterPlayer01, PunterPlayer02, ... PunterPlayer19. As a result I've gone back into the original filter (#Player# LIKE 'Player0%' OR #Player# LIKE 'Player1%') to update it to #Player# LIKE 'PunterPlayer%' . Unfortunately though, this gives me the error "Expression is NOT valid". Further, the original filter, which has always worked until now, when I validate it, also says "Expression is NOT valid".

Assistance would be appreciated :)

Image
Telepee
 
Posts: 23
Joined: Fri May 16, 2008 10:58 am

Re: Filter by Wildcard

Postby WhiteRider » Sat Mar 14, 2009 7:02 pm

There is a known issue in Beta 25 which means that some filters won't validate despite being correctly formed.
You can install Build 4 to a different folder and build your reports there then export them and import them into Beta 25. This is fixed for the next release.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Previous

Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 19 guests

cron