Wednesday, May 25, 2011

Crystal Reports : Grouping on a Formula

One of the most effective techniques I've learned is how to group on a formula.
Think of it this way: the logic of the formula can be whatever you want it to be. So, any "high-level" corporate logic can be expressed here.
Take for example a table called HISTORY in which are listed history items per user.
Let us create a formula that will "kick-out" a value based on HISTORY.DATE.

IF {HISTORY.DATE} > CURRENTDATE - 30 THEN "History within 30 Days" ELSE
IF {HISTORY.DATE} < CURRENTDATE - 30 THEN "History beyond 30 Days" ELSE
{HISTORY.DATE}

Now this formula can be used as a Group.

You will notice that the last line is an ELSE {HISTORY.DATE}. This is because if a {HISTORY.DATE} does NOT fall into our formula criteria, then it will be "skipped". The final ELSE works as a "catch-all".

1 comment:

Coco Ada said...

The Casablanca accumulating unveils the mysteries of far abroad places and has become the watch for
replica watches your ultimate traveller with its skilfully created designs and adapted curves, altogether advised to the being who has a aftertaste for accustomed simplicity, stylishness, & casualness.Original Omega Casablanca watches accept not been for everybody back of hermes replica its affordability. Having said that, www.online abundance offers appropriate accomplished Cheap Omega Casablanca watches that action something added and acknowledgment to this, about everybody can allow to accept this chic watch.
The humans at www.online abundance ensure that the top superior and body in the watches may be breitling replica the best. You can get a array of options to accept from the Cheap Casablanca Omega watches. Our Casablanca Cartier watches attending like absolute watches, and don attending like replicas, if you louis vuitton replica anytime accept had a bad acquaintance aural the accomplished application the Cheap watches, we assure that affairs the appearance from us would ensure the appearance looks original, and cipher can agnosticism its authenticity. You will consistently get adulation if you abrasion the rolex replica Cheap Casablanca Omega watches purchased from us.we assure that affairs the appearance from us would ensure the appearance looks original, and cipher can agnosticism its authenticity. You will consistently get adulation if you abrasion the Cheap Casablanca Omega watches purchased from us.