Expression is correct but won't validate

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

Expression is correct but won't validate

Postby zubs1aa » Sat May 15, 2010 6:55 pm

OK I read the tutorial on how to do custom report filters, but I can't get this to work for me.

Ex 1: I included the Site Name stat. So I want to filter for only stars.

I Insert and then add the target value and get the expression: #Site Name# = "PokerStars"
But it won't validate. WTF? this is a simple one...

what I really want to do is: #Site Name# = "PokerStars" AND "#Finish# = 0

But it won't let me. :(
zubs1aa
 
Posts: 2219
Joined: Fri Feb 08, 2008 1:52 pm

Re: Expression is correct but won't validate

Postby kraada » Sun May 16, 2010 9:01 am

I'm not sure why that won't validate off the top of my head, but if you do:
tourney_holdem_results.id_site = 100

it should (site 100 is PokerStars).

(You should also be able to do #Finish# = 0 in a separate line, or if you want to do it the same way as above, referencing the database element directly it would be tourney_holdem_results.val_finish = 0.)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Expression is correct but won't validate

Postby zubs1aa » Mon May 17, 2010 1:37 am

kraada wrote:I'm not sure why that won't validate off the top of my head, but if you do:
tourney_holdem_results.id_site = 100

it should (site 100 is PokerStars).

(You should also be able to do #Finish# = 0 in a separate line, or if you want to do it the same way as above, referencing the database element directly it would be tourney_holdem_results.val_finish = 0.)


Kraada- I can try that. But regardless the way I id it should work as it's the way the tutorial suggests and the way the insert function works.

Also, nowhere in the help or tutorial does it discuss how to use the advanced filters window and do Ands/Ors. Not clear if it is just one per line, needs the *ANd* or what. Also, the directions around how to use the validation was skimpy too.
zubs1aa
 
Posts: 2219
Joined: Fri Feb 08, 2008 1:52 pm

Re: Expression is correct but won't validate

Postby zubs1aa » Mon May 17, 2010 1:41 am

weird.

this validated: #Site Name# = 100

as did #Site# =100

This is really counter-intuitive. I'd expect to be able to look at the output of a field and use a value from it :(
zubs1aa
 
Posts: 2219
Joined: Fri Feb 08, 2008 1:52 pm

Re: Expression is correct but won't validate

Postby stevi3p » Mon May 17, 2010 5:11 am

You need a single quotation mark - 'PokerStars' not "PokerStars". That should work.
stevi3p
 
Posts: 71
Joined: Thu Mar 13, 2008 3:00 pm

Re: Expression is correct but won't validate

Postby kraada » Mon May 17, 2010 9:18 am

stevi3p wrote:You need a single quotation mark - 'PokerStars' not "PokerStars". That should work.


That validates for you? It's not validating for me - exactly which of the stats are you using?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Expression is correct but won't validate

Postby WhiteRider » Mon May 17, 2010 12:28 pm

I think that the filter must use the Value Expression of the stat, not the Format Expression.
The "Site Name" stat has a Value Expression of "id_site" - it is only the Format Expression which holds the text.
I don't know why it is defined that way, but there may be a technical reason for it (it might be something as simple as having it sort with the biggest sites first). I will see if I can find out from the development team.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Expression is correct but won't validate

Postby stevi3p » Mon May 17, 2010 2:23 pm

kraada wrote:
stevi3p wrote:You need a single quotation mark - 'PokerStars' not "PokerStars". That should work.


That validates for you? It's not validating for me - exactly which of the stats are you using?


Sorry, I didn't mean to imply I'd got it working. I noticed that the OP included double quotation marks, which won't work in SQL, and assumed that was the difficulty. (I did say "should" :D )
stevi3p
 
Posts: 71
Joined: Thu Mar 13, 2008 3:00 pm

Re: Expression is correct but won't validate

Postby kraada » Mon May 17, 2010 3:17 pm

We take that into account so it shouldn't be the problem here - it looks like the problem is that the value expression doesn't refer to the site's actual name but the site's number. One thought does occur: you can filter by site in the Simple Filters area, which should work as well and doesn't require knowing anything special.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Expression is correct but won't validate

Postby zubs1aa » Mon May 17, 2010 4:33 pm

WhiteRider wrote:I think that the filter must use the Value Expression of the stat, not the Format Expression.
The "Site Name" stat has a Value Expression of "id_site" - it is only the Format Expression which holds the text.
I don't know why it is defined that way, but there may be a technical reason for it (it might be something as simple as having it sort with the biggest sites first). I will see if I can find out from the development team.


You are probably right.

If so, this is a crappy implementation. The advanced filter window would be useless unless you already have gone and researched the underlying field values of all the fields. Not user friendly. (And this would apply to any field, not just site name)
zubs1aa
 
Posts: 2219
Joined: Fri Feb 08, 2008 1:52 pm

Next

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

Who is online

Users browsing this forum: No registered users and 7 guests