Love the new report builder. Can it do conditionals? For example, Can I create a custom report to read: Mickey Mantle (1-3, 2 2B, 3 RBIs, Run); Roger Maris (2-3, RBI)?

Statbook
2009-11-24 18:58

Yes, but it can get complicated. If you are familiar with SQL this will come naturally. If not, then feel free to make a request.

For the problem above, this will create what you are looking for (The Result field when editing a report):

p.first || " " || p.last || " " || "(" || (s.Single+s.Double+s.Triple+s.HomeRun) || "-" || (s.Plate-s.Walks-s.HitByPitch-s.Sacrifice) || (CASE WHEN s.Double=1 THEN ", 2B" ELSE (CASE WHEN s.Double>1 THEN ", " || s.Double || " 2B" ELSE "" END) END) || (CASE WHEN s.Triple=1 THEN ", 3B" ELSE (CASE WHEN s.Triple>1 THEN ", " || s.Triple || " 3B" ELSE "" END) END) || (CASE WHEN s.HomeRun=1 THEN ", HR" ELSE (CASE WHEN s.HomeRun>1 THEN ", " || s.HomeRun || " HR" ELSE "" END) END) || (CASE WHEN s.RBI=1 THEN ", RBI" ELSE (CASE WHEN s.RBI>1 THEN ", " || s.RBI || " RBIs" ELSE "" END) END) || (CASE WHEN s.Runs=1 THEN ", Run" ELSE (CASE WHEN s.Runs>1 THEN ", " || s.Runs || " Runs" ELSE "" END) END) || ")"

You can also go to the Statbook Downloads Page and import a similar example report (See the More Reports download link)

 

Average rating: 0 (0 Votes)

You cannot comment on this entry