Filtering a Cross Tab by a Date Range in Crystal Reporting - crystal-reports

I've got a cross tab that sums the number of records for each month across my data set, however I don't want all of the data set. I only want the cross tab to sum the data for each of the months for records that are related to the dates between 01/01/2022 to 31/12/2022.
Normally I would set a filter on the report to say this, but I am adding another section to the report which would not work if I had that filter set. I only want the filter to apply to the actual cross tab information.
Thanks in advance!

Related

Crystal reports - Can't filter on custom formula number field

Crystal reports don't let me use a custom count formula field to filter which transactions to show in a manager report.
I'm creating a Crystal report that team leaders are supposed to take out to see on how many occasions their employees have reported in sick. A record is only supposed to show if that person has reported in sick 6 or more times the last 12 months.
The report shows a record (a page) for each employee belonging to the managers organisational unit. Below the employee information is a subreport where I show the transactions from the salary/time system. Using select expert, I have filtered out the transactions that is supposed to show. I have then created a database field that count which day was 12 months back from today, and filtered so that only the transactions falling into this period shows.
My last problem is that I only want to show the record that has a minimum of 6 such transactions during the period. I created a formula field named #Antal ("amount" in Swedish) that simply counts the distinct number of dates in the "from"-date for the salary transactions I'm showing (since a change of law 2019-01-01 we needed to create a new transaction type, so some of the occasions after 2019 may have two transactions referring to one sick leave, thus I'm counting the first day of the period instead), DistinctCount ({P_LSTAT.P_SXXX06})
Now, the subreport has a new column with Antal (amount) that counts the amount of the desired salary transaction. I then try to use the selection formula to only show records where {#Antal} >= 6 but I get the following error:
This formula cannot be used because it must be evaluated later
Is there any other (better) way of doing this, or am I simply missing something?
For your selection based on {#Antal} >= 6 you need to use the group selection formula, not the record selection formula. Record selection is used to select records which meet the criteria before reading in the data. Group selection is used to filter out entire groups of records based on summarised values, after the records have been read in and the summaries calculated - which sounds like exactly what you need here.
The value of a Formula Field is out of scope when the Select Expert is evaluated.
There is no process for calculating the value of a Formula Field before it is printed within the section of the report it is placed. The Select Expert is evaluated prior to any section of the report being printed, so at this time all Formula Fields are effectively Nothing.

Exclude Filtered data from Group Totals in Report Builder

I have a stored procedure pulling data based on a parameter based "list date" range and rolling it up by month. My output gives me rows based on the month. I need to filter out the "Previous" values which actually represent 'To Date'
Month-------# Listed--------$ Listed
Previous---------125--------1,000.00
January-----------25-----------100.00
February----------50-----------500.00
To Date----------200---------1,600.00
I can easily use a Group filter or even a Tablix filter to eliminate the detail row for the 'Previous' entries.
Month-------# Listed--------$ Listed
January-----------25-----------100.00
February----------50-----------500.00
To Date----------200---------1,600.00
However, I cannot find a way to exclude the filtered detail from the Group totals. What I need to see is:
Month-------# Listed--------$ Listed
January-----------25-----------100.00
February----------50-----------500.00
To Date-----------75-----------600.00
I don't have the option of modifying the stored procedure. Any thoughts on how I can do this in Report Builder?
Using Tablix filtering and filtering out Previous should do the trick.

Crystal Reports: get access to linked elements in selection formula

I'm making a report using Crystal Reports 2008 and Peachtree database. Report should display customers who didn't place orders in a last 30 days. I already figured out how to link two tables in CR with left outer join. But I wasn't able to find how that linking can be used in formulas, such as selection formula. What I am trying to achieve is to get date of last placed order for current customer and use this information to determine if customer should be displayed or not.
What is the right approach to solving this problem?
Assuming your data is setup properly and adding 'customer' and 'last order date' to the details section shows you everything, then you can just add conditional formatting formula for the suppress property of the section when 'data date - last order date < 30', leaving you only showing records where last order date is more than 30 days.

Crystal reports crosstabs column grouping

I'm trying to build a cross tab report in Crystal XI that has dates, grouped by the month as column heading, and have 2 questions I'm trying to find answers to.
1: Is there any way to display a month even if there are no records to be summarized in that month? i.e. no orders for March, but want to display Jan, Feb, Mar.? I'm pretty sure I can create a dates table and use that spoof it, but don't want to go that route as the database is part of a Vendor's package and I don't want to get to crazy in there.
2: Is there a way of specifying or limiting how many columns go across? For example in a forecast cross tab I only owant current month and the next six months to show up. I suppose I can do a date range on the selection criteria, but that seems a bit kludgy to me.
Thanks for any answers
Short answer: No.
I've seen discussions about workarounds involving creation of temporary tables, but I've never tried any such solutions myself.
I would go with the date range on the selection criteria. You could make those dates parameters for more convenient useage. If you have sevral cross-tabs that should have different date ranges you could put the crosstabs in sub-reports.

How to make zero tablix data rows appear?

I am developing an SSRS 2008 report. I created a tablix, however, when I view this report one of the rows has zero entries. This row is not showing in the output. How can I make it show regardless of values so that it will just show "0" otherwise?
This was the expression I used for it:
=iif(CountDistinct(Fields!Client.Value)=0 or
isnothing(countdistinct(Fields!Client.Value)),0,
CountDistinct(Fields!Client.Value))
And I have tried grouping on different fields and also filtering on another field, but none of these make it appear when there is no data.
I think that the best you can do is ensuring that the dataset you are using has the record you want, even if it is null. For example, if you are grouping months, and you want all 12 months to appear in your tablix, then you need to make those months to exist in your dataset even if they have null values for all the other columns.