Discuss how to create custom stats, reports and HUD profiles and share your creations.
Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators
by BillGatesIII » Sun Aug 06, 2017 9:44 am
I dived into my archives and found an easier way to determine the highest card on the flop.
- Code: Select all
(greatest(mod(cash_hand_summary.card_1 - 1, 13), mod(cash_hand_summary.card_2 - 1, 13), mod(cash_hand_summary.card_3 - 1, 13)) + 1)
This expression returns an A as 13.

- Highest flop card.png (9.68 KiB) Viewed 5320 times
-
BillGatesIII
-
- Posts: 740
- Joined: Fri Dec 16, 2011 6:50 pm
by pt4pt4pt4 » Sun Aug 06, 2017 10:34 pm
BillGatesIII wrote:I dived into my archives and found an easier way to determine the highest card on the flop.
- Code: Select all
(greatest(mod(cash_hand_summary.card_1 - 1, 13), mod(cash_hand_summary.card_2 - 1, 13), mod(cash_hand_summary.card_3 - 1, 13)) + 1)
This expression returns an A as 13.
Highest flop card.png
Very useful Bill, thanks for the share.
-
pt4pt4pt4
-
- Posts: 1097
- Joined: Fri Feb 03, 2012 12:17 am
-
by Guest666 » Fri Aug 11, 2017 12:25 pm
Thank you!
But why It working in filter and did not working in stat?
- Attachments
-

-

-
Guest666
-
- Posts: 22
- Joined: Fri Aug 14, 2009 6:05 pm
by BillGatesIII » Wed Aug 16, 2017 5:14 am
The PT4 parser gets confused when using if[] with comma's inside. The workaround is to use 'case when ... end' (that is how the if[] statement is translated to PostgreSQL by PT4 so basically we are just doing it for them already).
- Code: Select all
sum(case when mod(cash_hand_summary.card_2 - 1, 13) = 2 then 1 else 0 end)
-
BillGatesIII
-
- Posts: 740
- Joined: Fri Dec 16, 2011 6:50 pm
by Guest666 » Thu Aug 17, 2017 6:08 am
I am very much obliged to you, Bill
Can someone come in handy:
middle pair or middle stranght hands on River
- Code: Select all
(
(tourney_hand_player_combinations.flg_r_1pair and (tourney_hand_player_combinations.id_r_hand_strength =2)and( tourney_hand_player_statistics.flg_r_saw and ( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13) or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13) ))) Or
(tourney_hand_player_combinations.flg_r_2pair and (tourney_hand_player_statistics.flg_r_saw)and(((tourney_hand_player_combinations.id_r_hand_strength =3)and( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[3]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13)or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[3]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13)))or((tourney_hand_player_combinations.id_r_hand_strength =2)and not((sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=(sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[5]) and( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13)or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13)))or(tourney_hand_player_combinations.id_r_hand_strength between 3.99 and 5.01 AND (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]<mod(tourney_hand_player_statistics.holecard_2 - 1, 13)))) Or
(tourney_hand_player_combinations.flg_r_flush and (tourney_hand_player_combinations.id_r_hand_strength between 5.99 and 8.99 ) and tourney_hand_player_combinations.val_r_hole_cards_used=1) Or
(tourney_hand_player_combinations.flg_r_fullhouse and (tourney_hand_player_combinations.id_r_hand_strength between 0.99 and 2.01))
)
less then middle pair on River
- Code: Select all
(
(tourney_hand_player_combinations.flg_r_highcard) Or
((tourney_hand_player_combinations.flg_r_1pair and tourney_hand_player_combinations.id_r_hand_strength<3) and not (tourney_hand_player_combinations.flg_r_1pair and (tourney_hand_player_combinations.id_r_hand_strength =2)and( tourney_hand_player_statistics.flg_r_saw and ( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13) or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13) )))) Or
((tourney_hand_player_combinations.flg_r_2pair and ((tourney_hand_player_combinations.id_r_hand_strength between 3.99 and 5.01) or (tourney_hand_player_combinations.id_r_hand_strength between 0.99 and 2.01) ))and not((tourney_hand_player_combinations.flg_r_2pair and (tourney_hand_player_statistics.flg_r_saw)and(tourney_hand_player_combinations.id_r_hand_strength =3)and( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[3]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13)or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[3]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13)))or(tourney_hand_player_combinations.flg_r_2pair and (tourney_hand_player_statistics.flg_r_saw)and(tourney_hand_player_combinations.id_r_hand_strength =2) and( (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_1 - 1, 13)or (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=mod(tourney_hand_player_statistics.holecard_2 - 1, 13)) and not((sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=(sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[5]))or(tourney_hand_player_combinations.flg_r_2pair and (tourney_hand_player_statistics.flg_r_saw)and tourney_hand_player_combinations.id_r_hand_strength between 3.99 and 5.01 AND (sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]<mod(tourney_hand_player_statistics.holecard_2 - 1, 13))or(((sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[4]=(sort(array[mod(tourney_hand_summary.card_1 - 1, 13),mod(tourney_hand_summary.card_2 - 1, 13),mod(tourney_hand_summary.card_3 - 1, 13),mod(tourney_hand_summary.card_4 - 1, 13),mod(tourney_hand_summary.card_5 - 1, 13)]))[5]) and (mod(tourney_hand_player_statistics.holecard_1 - 1, 13)=mod(tourney_hand_player_statistics.holecard_2 - 1, 13)))))Or
(tourney_hand_player_combinations.flg_r_threeoak and (tourney_hand_player_combinations.id_r_hand_strength=0)) Or
(tourney_hand_player_combinations.flg_r_straight and (tourney_hand_player_combinations.id_r_hand_strength=0)) Or
(tourney_hand_player_combinations.flg_r_flush and (tourney_hand_player_combinations.id_r_hand_strength between 1.99 and 5.09 ) and tourney_hand_player_combinations.val_r_hole_cards_used=1) Or
(tourney_hand_player_combinations.flg_r_fullhouse and (tourney_hand_player_combinations.id_r_hand_strength=0)) Or
(tourney_hand_player_combinations.flg_r_strflush and (tourney_hand_player_combinations.id_r_hand_strength=0)) Or
(tourney_hand_player_combinations.flg_r_fouroak and (tourney_hand_player_combinations.id_r_hand_strength=0))
)
-
Guest666
-
- Posts: 22
- Joined: Fri Aug 14, 2009 6:05 pm
by sxw279 » Tue Feb 25, 2020 5:57 pm
Code, how to use it, and where to paste it
-
sxw279
-
- Posts: 7
- Joined: Fri Oct 09, 2015 9:04 pm
by stockHudson » Mon Jun 12, 2023 8:16 am
EDIT:
as usual after a few minutes I found the answer myself.
I followed the instructions listed here:
https://www.pokertracker.com/forums/viewtopic.php?f=61&t=59017&p=291073&hilit=intarray#p291073:
--------
Hi, sorry for gravedigging.
I am interested in this topic, and I tried the last code that was provided.
if I put that code in the expression filter in my custom report I get an error "expression is not valid" because of the SORT function.
I believe it's related to the intarray extension, but I tried searching the forums and I didn't find useful info.
So how can I get that code to work? thanks
-
stockHudson
-
- Posts: 2
- Joined: Wed Feb 10, 2021 9:15 am
Return to Custom Stats, Reports and HUD Profiles
Users browsing this forum: No registered users and 75 guests