Thursday, March 27, 2014

Crystal Reports : Formulas and Counting

Using simple Summaries (Insert | Summary) in Crystal is great, don't get me wrong, but they are inflexible. For instance, when summarizing (trying to get a count) on {INVOICE.INVNUM}, ALL invoice numbers are evaluated, including duplicates (unless a Distinct Count is being used).

Which usually is fine, but there is always some sort of exclusion to be made; we only want invoices that DON'T begin with "000150" because it a House Account, etc. And you could handle this within your Selection Criteria handily enough; but let's imagine that it screws up other parts of the report; excluding House Accounts impacts other Subtotals, etc.

So to accomodate this little pickle, we will use a formula to count, one record at a time. This is actually a very popular Crystal Technique and you see it a lot in older, more "veteran" reports.

Create a formula called
IF MID({INVOICE.INVNUM}, 1, 6) <> 000150 THEN 1 ELSE 0

So what the formula is doing is evaluating the first six digits of the Invoice, and if it ISN'T a House Account, it returns 1 (we want to count it), otherwise it returns 0 (we want to exclude it).

Now, create a simple Summary on {@InvoiceCount} and make it a SUM operation, this way you get a count of only the records you want (for the particular task at hand), without sacrificing any existing Selection Formulas or Summary operations.


devil jiang said...

As for the brunette, she draining the life energy out of the men she bags, but how and rolex datejust replica why become incomprehensible muddles. Even worse, Parker swiss replica watches figures it all out way too easily, using a few baffling clues to conjure a theory out of whole cloth and replica breitling hitting upon a solution to Duke dilemma with only the barest hints of logic. The episode basically pulls a resolution replica watches uk out of its ass, whitewashes it with some hand waving, and presents it to us as a finished product. Its shoddiness would be excusable if it occurred maybe once or twice, but dior outlet Haven does this every week without fail. It didn work the first time; what on earth makes the show runners think it will work the fifth?

wei coco said...

One of the easiest means to replica watches atom a affected is by its bright display, or caseback, which
allowsi you to see the close apparatus of the watch. The absolute McCoy does not accept such a feature, with the barring of louis vuitton replica some best 1930s exhibition models that were never mass-produced.Just as never bogus bright casebacks, it did not bite them either.Genuine models will accept a bland caseback, whilst fakes ability affection engraved logos and other designs. The attenuate exceptions are the pre-1990s ladies' models, which had "Original Rolex Design" or a agnate aberration thereof, engraved on breitling replica the caseback. Another barring is the
Sea-Dweller display, which has engraved about the outside of the caseback.A absolute Rolex has a 3D hologram-encoded sticker on the caseback. For models produced afterwards 2002, a Rolex acme can be beheld on the sticker and it changes patterns if you see it from altered angles. A usually has a alliterative Rolex arrangement printed on it and does not change if beheld from added angles.Keep in omega replica apperception too that Rolex has alien a tiny acme logo categorical assimilate the clear at the breadth about the six o'clock direction afterwards 2002, so this should not be present in beforehand models. This affection may not,however, be applicative to all Rolex watches.

dong dong23 said...

cincinnati bengals jerseys
polo ralph lauren shirts
true religion jeans
ray ban eyeglasses
ugg outlet
ugg outlet
longchamp handbags
red bottoms
coach factory outlet
prada handbags

chenlina said...

mbt outlet clearance
roshe run flyknit
giuseppe zanotti
burberry handbags
toms shoes
rolex watches
adidas nmd shoes
scarpe hogan