border color change on weekends and bank holidays in Crystal Reports calendar - crystal-reports

I'm writing a report in Crystal Reports where it basically shows an annual calendar of all the different types of absences employees might have had during the year, though my client said he wants to see the weekends marked differently.
I have tried using a formula on the borders this way:
IF DayOfWeek (CurrentDate) = 7 or DayOfWeek (CurrentDate) = 1 then crRed
else crNoColor
No error is given, but nothing is presented in red on the report once I generate it when its Saturday or Sunday.
Am I going the right way?

Related

Previous Month Calculation without Date Filters or Attributes in Report

I am trying to create a report that shows total sales for the previous financial year (March-April), the current financial ytd, and the previous month in powerbi. I do not want to include any date attributes in the report or place any date filters on the report.
The 2 measures below are working as expected, but I am running into issues when trying to calculate for the previous month.
This Year = CALCULATE('Fact InvoiceLine'[Total Fare Currency],
DATESYTD(ENDOFYEAR(dateadd('Date'[Date], -2,Year),"3/31"),"3/31"))
Previous Year = CALCULATE('Fact InvoiceLine'[Total Fare Currency],
DATESYTD(ENDOFYEAR(dateadd('Date'[Date], -3,Year),"3/31"),"3/31"))
The closest I have been able to get, though it's still far from what I need.... is this,
Last Month = CALCULATE('Fact InvoiceLine'[Total Fare Currency],
DATESMTD(ENDOFMONTH(dateadd('Date'[Date], -2,YEAR))))
which goes back 11 calendar months, but what I need is to see the total for 1 calendar month. Using PREVIOUSMONTH does not work either, as that requires either a date filter or date value in the report.
Last Month =
CALCULATE([Total Fare Currency],
FILTER(ALL('Date'),'Date'[Date] >= EOMONTH(TODAY(),-2)+1),
FILTER(ALL('Date'),'Date'[Date] <= EOMONTH(TODAY(),-1))
)

Different color on crosstab report

I want to make a field a certain color based on the difference between its transaction date and today.
I'm using the formula
IF DateDiff ('D',{Command.DATE_RECEIVED},CurrentDateTime)>=6
THEN CRRED
ELSE IF DateDiff ('D',{Command.DATE_RECEIVED},CurrentDateTime)<6
THEN CRYELLOW
ELSE IF DateDiff ('D',{Command.DATE_RECEIVED},CurrentDateTime)<3
THEN CRGREEN
But everything show's red, even for items received today.

Filter SSRS subreport for 12 months from first day of month to last day of month

I have a SSRS report that has typical Start Date / End Date parameters that will filter out Sales Order information based on the OrderDate field. With this report, I have a subreport. This subrebort is basically nothing more than an aggregation of the same info, by month. This aggregate information should be from the first day of the month, one year prior, through the last day of the End Date's parameters month. This does not take the main subreports Start Date parameter into consideration at all.
This is where it gets a little tricky. For example, lets say I made the start date / end date parameters on my main report:
10/15/2016 - 11/15/2016
(just remember, for this purpose, the start date is irrelevant)
I would want the subreport to show the sales totals, per month, for the ENTIRE month of December 2015 through the ENTIRE month of November 2016, even though my end date was 11/15/2016.
If I were to put in those same dates for my parameters in the report right now, for the aggregation of December 2015, I would only get sales from the 15th through the 31st. Currently I have my subreport to filter on the OrderDate by:
Fields!OrderDate.Value>= DateAdd(DateInterval.Month, -12,Parameters!EndDate.Value)
I know that this filter is not currently set up to have an end date for the parameter, just a greater than argument, which is wrong since I want the 12 month history to stop at the last day of the month for the month of my End Date parameter, but I don't know how to make that happen either.
I hope I have explained this well. Any help on this would be greatly appreciated.
You can set a filter to get only dates between a specific range in your subreport dataset, tablix and some visualizations:
In DataSet properties or Tablix Properties in the Filter tab use these settings:
In the Value textboxes you should use the expressions to calculate your date range.
StartDate
=DateSerial(Parameters!EndDate.Value.Year-1,Parameters!EndDate.Value.Month,1).AddMonths(1)
EndDate
=DateSerial(
Parameters!EndDate.Value.Year,Parameters!EndDate.Value.Month,1).AddMonths(1).AddDays(-1)
It should filter your data from 12/01/2015 to 11/30/2016 if your EndDate parameter is set to 11/15/2016
Let me know if this helps.

Altering x-axis for dates in Tableau

I have a data set that has dates for many years. I can easily filter the data by month or week, but I was hoping to change the X axis to make it start in October and end in April.
Is there a way to do this in Tableau without altering the original data and listed dates?
I don't know about it ending in April since that would not be a full 12 months but you can make it start in October. Right click on your date field > Default Properties > Fiscal Year Start. Then select October.

Summarize years 2010-2013 display detail of 2014 and 2015

I'm new to crystal reports 2011 and I'm trying to develop a report that shows the monthly detail for years 2014 and 2015, and only summarizes years 2010-2013. I have the year as my grouping and I"m able to see all 6 years data summarized when I hide the drill down, but I want to show my customer the monthly data from 2014 and 2015 in detail. Any help would be appreciated!
There's a few ways this can be done:
Group on both year & month. In the "section expert" dialogue, define a formula to conditionally suppress the monthly details for appropriate years, e.g., {table.year} < "2014" (assuming year is a string, change as needed.
Define your own formula and then group on that custom formula, e.g.,:
if {table.year} < "2014" then {table.year} else
{table.month} & " " & {table.year}
The second one also presumes your values are stored as strings, you can use totext() to convert non-strong values if necessary. Option 1 is probably easier to present nicely, Option 2 might give a greater level of flexibility for future use of the rpt as a template with arbitrary grouping, though might still require multiple groups and conditional suppression to have it display exactly as desired, but these should point you in the right direction.
You can create 2 groups, one by year and one by month and write supress condition of month group like when year < 2014 then supress.
if year<2014
then true
else false