November 5, 2005

Only see what you want to review.

Until now, we have been creating reports that see everything all at once. It's a big picture view, but let us say we wanted to only see a smaller snapshot. For example, instead of seeing all patient visits in one report, we just wanted to see the ed patients admitted during the last week. Crystal reports offers a cool way to apply constraints or filters to reports through the Select Expert.

The Select Expert is a GUI enabled way to create a where clause for a report. We can take our drill down example report and apply a selection to it. Under the report menu, select Selection Expert. For our example, select orders over a quantity of 100, so select Order_Details.Quantity and click ok.

The Select Expert window appears, please take a moment and notice that the requested field, Order_Details.Quantity is the first tab. Now it is time to apply our algorithm, we select is greater than 100, as indicated below. Once we have finished, we can click ok.

Crystal Reports then request if it is ok to use the save data set, or if we want to refresh. Since Northwind is a stagnant data set, refreshing doesn’t harm any analysis.

Now we see the report with our filter applied, however for shits and giggles, let us see what happened in the year 1997. To add a new constraint, click on the selection expert, and click on the <New> tab.

Choose the order date field and click ok.

So for the order date, we want all orders between January 1st, 1997 and January 1st, 1998. Once you are set, just click ok and we are good to go.



To finish up this example, by adding a selection for a string. There are two wildcard characters that are available within the Select expert. ? is a wildcard for just one character, while * is a wild card for many characters, these are available when using the is like and is not like filter. We are going to look for all products that are like Pa, but remove the year they were ordered by selecting the order date tab and clicking delete. Now click on the <New> tab, and add our filter on product name.

When we get back into the report, we can note that we have not sold any products starting with PA and have a quantity above a 100.

Posted by Elyse at November 5, 2005 7:58 AM
Comments
Post a comment









Remember personal info?