Trying to color code different rows in report.

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Trying to color code different rows in report.

Postby pokertrackfan77 » Mon Feb 14, 2022 2:56 pm

Hi,

I don't have a coding background.

I need help understanding the syntax of this code:
Code: Select all
if(amt_won > 40, rgb(225, 255, 255), rgb(255, 225,225))


So i'm guessing there are 3 arguments. The first is the logical argument or the parameter you are setting for your statistic. The Second is saying if the logical argument is true, then produce this color? Then is the third saying if it's not true, then this color?

I assume rgb(225, 255 ,255) has nothing to with the parameter but is rather the specific color you want to use in your report, right?

How would i highlight only players that are between 30 and 40 vpip in report? Would it look something like this?
Code: Select all
 if(cnt_vpip > 30 and cnt_vpip < 30, rgb(225, 255, 255), rgb(255, 225,225))


Thanks
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm

Re: Trying to color code different rows in report.

Postby pokertrackfan77 » Mon Feb 14, 2022 3:14 pm

Could someone tell me why the code isn't working below?
Why are there three colors? Blue, red and white, when i specified 2. Also notice that the pfr's less than 18 can also be red.

Thanks
Attachments
pokertracker filter1.jpg
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm

Re: Trying to color code different rows in report.

Postby Flag_Hippo » Tue Feb 15, 2022 6:51 am

pokertrackfan77 wrote:So i'm guessing there are 3 arguments. The first is the logical argument or the parameter you are setting for your statistic. The Second is saying if the logical argument is true, then produce this color? Then is the third saying if it's not true, then this color?

Yes.
pokertrackfan77 wrote:I assume rgb(225, 255 ,255) has nothing to with the parameter but is rather the specific color you want to use in your report, right?

Yes.
pokertrackfan77 wrote:How would i highlight only players that are between 30 and 40 vpip in report? Would it look something like this?
Code: Select all
 if(cnt_vpip > 30 and cnt_vpip < 30, rgb(225, 255, 255), rgb(255, 225,225))

Using cnt_vpip isn't going to work for that (see below re: pfr) and if you want test for a value between two numbers you can use:

Code: Select all
between 30 and 40

pokertrackfan77 wrote:Could someone tell me why the code isn't working below?
Why are there three colors? Blue, red and white, when i specified 2.

Blue is the row highlight color for the selected row (Configure -> Reporting Options).
pokertrackfan77 wrote:Also notice that the pfr's less than 18 can also be red.

Your expression is using cnt_pfr which is the number of times a player raised preflop. If a player had the opportunity to PFR once and did so then their cnt_pfr would be 1 and their PFR percentage would be 100% and you are testing for the former rather than the latter:

Code: Select all
(cnt_pfr / cnt_pfr_opp) * 100 > 18
Flag_Hippo
Moderator
 
Posts: 15211
Joined: Tue Jan 31, 2012 7:50 am

Re: Trying to color code different rows in report.

Postby pokertrackfan77 » Tue Feb 15, 2022 10:07 am

Flag_Hippo wrote:
pokertrackfan77 wrote:S
pokertrackfan77 wrote:Also notice that the pfr's less than 18 can also be red.

Your expression is using cnt_pfr which is the number of times a player raised preflop. If a player had the opportunity to PFR once and did so then their cnt_pfr would be 1 and their PFR percentage would be 100% and you are testing for the former rather than the latter:

Code: Select all
(cnt_pfr / cnt_pfr_opp) * 100 > 18


Thanks for your help!

Would you be able to help me figure out why this code isn't working? I believe i used the order of operations right.

Also what does "Has Summary" do if i check that box?

Thanks
Attachments
PT screenshot 2.jpg
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm

Re: Trying to color code different rows in report.

Postby Flag_Hippo » Tue Feb 15, 2022 1:06 pm

pokertrackfan77 wrote:Would you be able to help me figure out why this code isn't working? I believe i used the order of operations right.

You've removed spaces from the expression I provided.
pokertrackfan77 wrote:Also what does "Has Summary" do if i check that box?

It adds a summary line to the bottom of the report.
Flag_Hippo
Moderator
 
Posts: 15211
Joined: Tue Jan 31, 2012 7:50 am

Re: Trying to color code different rows in report.

Postby pokertrackfan77 » Tue Feb 15, 2022 1:09 pm

Flag_Hippo wrote:
pokertrackfan77 wrote:Would you be able to help me figure out why this code isn't working? I believe i used the order of operations right.

You've removed spaces from the expression I provided.
pokertrackfan77 wrote:Also what does "Has Summary" do if i check that box?

It adds a summary line to the bottom of the report.


Thanks! That worked.

Something i noticed is that it works for pfr, but i guess there’s no column called cnt_vpip_opp. Do you know how i would be able to calculate vpip opportunities or if there’s a column that exists that does that?
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm

Re: Trying to color code different rows in report.

Postby pokertrackfan77 » Tue Feb 15, 2022 1:35 pm

Could you confirm if this code is correct for calculating vpip greater than 35?

Code: Select all
cnt_vpip / (cnt_hands - cnt_walks) * 100 > 35


My reasoning is that cnt_vpip is counting the amount opportunities to play a hand (raise, call or fold), but if everyone folds to the BB, then you don’t have a chance to voluntarily put money in the pot.
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm

Re: Trying to color code different rows in report.

Postby Flag_Hippo » Tue Feb 15, 2022 2:05 pm

pokertrackfan77 wrote:Could you confirm if this code is correct for calculating vpip greater than 35?

Code: Select all
cnt_vpip / (cnt_hands - cnt_walks) * 100 > 35

Yes that's correct. You can get this from the 'Value Expression' for the VPIP statistic in 'Configure -> Statistics'.
pokertrackfan77 wrote:My reasoning is that cnt_vpip is counting the amount opportunities to play a hand (raise, call or fold),

cnt_vpip is a count of how many times that player VPIP'd and not the opportunities. The opportunities to VPIP are the sum of (cnt_hands - cnt_walks).
Flag_Hippo
Moderator
 
Posts: 15211
Joined: Tue Jan 31, 2012 7:50 am

Re: Trying to color code different rows in report.

Postby pokertrackfan77 » Tue Feb 15, 2022 3:59 pm

Thanks for your help, Flag_Hippo!
pokertrackfan77
 
Posts: 24
Joined: Mon Sep 02, 2019 2:05 pm


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 25 guests

cron
highfalutin