I have designed student ID Card using crystal report version 13_0_9 for visual studio 2013.
There 2 fields on student ID card that reflect year and month. For the field year I need to show it as 2015 - 2016. And for month it need show as June To May.
I tried placing two special fields for year, month and formatted to show only year and month value.
But the fields reflect only current year and month, how do I achieve this to reflect year as 2015 - 2016 and month as June To May. See below Image.
https://onedrive.live.com/?cid=9F3DE61006533307&id=9f3de61006533307%211621&v=3
A formula called Year:
cstr(Year (CurrentDateTime),"#") & '-' & Right(cstr(Year (CurrentDateTime) + 1 ,"#"),2);
and one called Month
cstr(CurrentDateTime,"MMM") & ' to ' & cstr(DateAdd("m",11,DateAdd("y", 1, CurrentDateTime)),"MMM")
I'm on Crystal standalone but should work equally in VS 2013
Related
I need to create a field of previous year total sales in the current year column.
Here is an example based on it being 2018 today: in 2018, it should be 2017 total sales(full year), in 2019, it should be 2018 Sales(jan-apr would be only months in may), and 2020 should be blank, as there are no data in 2019 yet, etc.
Use the calculation to make it as "Date-1".
I've tried so many times to solve this, but failed.
Question:
I help on a solution on how to calculate Current Year divided by last year in our Fiscal Year, month by month, where last years date differs from this years date
Scenario
I want to see how we performed on revenue January 2017 vs. January 2016
I select these date filters; YEAR = 2017 and Month = January. This will generate the dates 1st January to 31st January 2017
But, the dates for 2016, is not 1st January to 31st January
My company's logic is; Which DAY NAME was the 1st January of 2017 and find this first DAY NAME in January 2016 and then see which DATE this has.
Scenario Example:
2017 = 1 - 31 January and the DAY NAME for 1st January is "Sunday"
2016 = The date for the first Sunday in 2016 is 3rd January, therefore, the dates for January 2016 = 3 January - 2. February
My problem is how to make a formula that takes this year and divide that on last year's date range logic
What have I done?
First I created a formula; CALCULATE(SUM(Append1[SalesAmount]);SAMEPERIODLASTYEAR(Append1[Date]);ALL(Append1);FILTERS(Append1[Channel]))
This worked perfectly, but this just calculates 1-31 January 2017 / 1-31 January 2016 (calendar year, not fiscal year).
Googled through many, many Power BI post regarding Rolling months, DAX, DATE DAX and such, but i still haven't been able to come up with a solution.
Hope some of you can help me in the right direction!
Regards Erik
You can create a calculated column that gives the corresponding date from the previous year as follows:
DateLastYear =
VAR CurrDate = Append1[Date]
VAR LastYear = DATE(YEAR(CurrDate)-1,MONTH(CurrDate),DAY(CurrDate))
VAR Offset = MOD(WEEKDAY(CurrDate) - WEEKDAY(LastYear),7)
RETURN LastYear + Offset
Given this, you can create a calculated column that looks up the sales amount on those dates:
LastYearSalesAmount =
LOOKUPVALUE(Append1[SalesAmount],Append1[Date],Append1[DateLastYear])
At this point, you should be able to create your ratio as follows:
DIVIDE(SUM(Append1[SalesAmount]), SUM(Append1[LastYearSalesAmount]))
I need to modify some Tableau dashboards so that they show from the previous month going back 12 months.
For example, it is August 2017 now, so the company wants to see the 12 months ending at July 2017. In other words: Aug 2016, Sept 2016, Oct 2016...June 2017, July 2017.
Using Tableau's relative date filter, users can easily select "previous month" (July 2017) or "previous 12 months" (Sept 2016-Aug 2017) on the relative date filter. But they can't choose previous month going back 12 months (Aug 2016-July 2017).
I was thinking of writing a formula that sets current month as 0, previous month as 1, month before that as 2 etc and that way I can filter to only show months 1, 2, ...12. And not show month 0, the current month.
Is this the best approach? I thought Tableau would have an option for this - surely a lot of companies want to see a year worth of data ending at the previous month? (Since the current month is not yet complete so they don't want to see a partial month's data).
Thanks for your ideas!
You are right about this being a common requirement. I do 'Last 12 months' filter too which excludes current month since it is not a full month.
In my case I have defined a True/False type calculated field which I use to filter records which show in the dashboards.
Here is the formula that I use:
DATEDIFF('month',[My Timestamp Field],Today()) < 13 and DATEDIFF('month',[My Timestamp Field],Today()) > 0
I have a cross-tab table that I want to group each column by an specific month for each year. (ex. March 2011, March 2012, March 2013 and so on).
I'm guessing that a formula is needed to do this since there's no predefined functions in CR that can help me group dates like that.
Is this true?
I'm trying to take one group and put it in two different columns. I know you can do that for the details of a group in the section expert but it won't allow you do so for a group. The group is date that I've separated by months for the all of last year and this year to the current date and I want last year's months in one column and this year's months in another column. Like this:
January 2011 January 2012
February 2011 February 2012
March 2011 March 2012
April 2011 April 2012
May 2011
June 2011
July 2011
August 2011
September 2011
October 2011
November 2011
December 2011
That way the months are easy to compare and they can be drilled down. Any ideas?
In Details section's 'Section Expert', select 'Format with Multiple Columns'
Select the (now visible) Layout tab
Select 'Format Groups with multiple column'
Add a second group on your date field by year (make sure it is 'outside' the mm/yyyy grouping)
Size the footer of the section you created in #4 to get each year to be in its own column
If you group by month name (like monthname({transaction.date}) so January 2011 and 2012 will be in the same group) then you can use a running total to summarize the years individually within that group. You can do this by creating two running total fields, one with an evaluate formula like year({transaction.date})=2010 and another with the formula year({transaction.date})=2011.
Note that running totals won't work in the group header though, so you'd need to migrate those fields down into the group footer instead.
How about using a cross-tab like:
2011 2012
January 10 12
February 5 12
March 8 1
This would be a lot more flexible.