How To's

ID #1009

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)?

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)

 

Categories for this entry

Tags: -

Related entries:

Last update: 2009-11-24 18:58
Author: Statbook
Revision: 1.2

Digg it! Print this record Send FAQ to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry