I'm having a doubt in how to sort a chart by custom date in Crystal Reports.
My Sql returns this for exemple:
Date
2013 Set
2013 Set
2013 Out
2013 Nov
I get this value using Decode, the code is above
EXTRACT(YEAR FROM S.sol_datachega) || ' ' || decode(EXTRACT(MONTH FROM S.sol_datachega),1,'Jan',2,'Fev',3,'Mar',4,'Abr',5,'Mai',6,'Jun',7,'Jul',8,'Ago',9,'Set',10,'Out',11,'Nov',12,'Dez') as mes
But x axis in my crystal reports sort by the string, so the chart comes like this:
2013 Nov
2013 Out
2013 Set
If i take the decode off the chart comes right
2013 09
2013 10
2013 11
But i need it with the name of the month instead of number.
I believe i can do this using formulas but i don't know how to do it because i'm new in crystal reports.
Any idea?
After doing some testing myself, it seems that there are limitations to what you are trying to achieve. Ken Hamady has an excellent write-up on the ways and limitations to formatting chart dates. Please see his write-up here and hopefully it will help you.
Related
I am creating a report on Visual Studio and I need to sum the columns based on the year. My data has number of packages for the year 2019 and 2020. I want a grand total for 2019 and for 2020 as the last column on my report. I try to sum it up , and it sums up 2019 and 2020 for my parameter and gives me that total. Any help here will be appreciated
I have an excel data with Data(from May 2019 to Jan 2020), few columns have been added in power bi mainly Month Number and Month Name.
For Month Name, sorting has been done by Month Number.
However, when i put the Bar graph, and sort it i get the bar graph from Jan 2020, May 2019, June 2019, July 2019 so on until Dec2019.(Image has been attached)
Do we have any way where we can put the graph starting from May 2019 all the way to Jan 2020 in x-axis.
I would suggest creating a date field and using that in the chart instead. The calculation could be something like:
Month New = DATE([Year],[Month Number],1)
Then you can customize the date field to just show the MMM-YY part. This way your sorting issues will be resolved and you won't face any issues in the future as well.
Today I had to upgrade my developer edition of SQL Server, going from 2014 to 2017.
With this I also had to upgrade our reports using SSDT 2017. Our old report datasets where in MDX format, and it had no measures defined, which 2017 really kicked off about when we tried running them.
Unfortunately we could not remove them using Query designer, so had to delete the DS and we create it. The MDX didn't bring back any data in query designer, but DAX did, so we went with that option.
However, every time we run it in previewer and on our server, no data is returned. Below is the code that was created by Query Designer.
DEFINE VAR ArchiveArchiveId1 = IF(PATHLENGTH(#ArchiveArchiveId) = 1,
IF(#ArchiveArchiveId <> "", #ArchiveArchiveId, BLANK()),
IF(PATHITEM(#ArchiveArchiveId, 2) <> "", PATHITEM(#ArchiveArchiveId, 2),
BLANK()))
VAR ArchiveArchiveId1ALL = PATHLENGTH(#ArchiveArchiveId) > 1 &&
PATHITEM(#ArchiveArchiveId, 1, 1) < 1
EVALUATE SUMMARIZECOLUMNS('Archive'[ArchiveId], 'Archive'[Block Name],
'Archive'[Comments], 'Archive'[Condition], 'Archive'[Consequence],
'Archive'[Element], 'Archive'[Facet], 'Archive'[HasPhoto],
'Archive'[Likelihood], 'Archive'[Local Department Name Whole Block],
'Archive'[Photo Filename], 'Archive'[Remaining Life Yrs], 'Archive'[Remedial
Action], 'Archive'[Risk], 'Archive'[SiteName], 'Archive'[Sub Element],
'Archive'[Year], FILTER(VALUES('Archive'[ArchiveId]), ((ArchiveArchiveId1ALL || 'Archive'[ArchiveId] = ArchiveArchiveId1))))
If anybody has any suggestions on how to manually change that to get it to actually work live and not just in query designer that would be great (taking out the parameter works but we need it in as we have a lot of archive ids).
Thanks in advance
Specifically, if the report is scheduled for the 31st of every month, at 11:59 PM, I want the report to show data from that month.
Example: Report is run on Jan 31, 2016 11:59 PM. I would like the data to show everything with Task Finish Date from Jan 1, 2016 - Jan 31, 2016.
Thanks!
the simplest way is to create variable which will return for specified dates in cross table zero or one. Then set filter on it and show only 'ones'.
the solution you've provided is also simple - fistdayofmonth might be created by creating new date as year(run_date)+monthnumber(run_date)+"01"
I have built two queries using two different Universe. One Universe will give me data for the year 2015 and another data will give data for 2016.
Our fiscal calendar for 2015 ( October 2014 to September 2015). Hence I have the complete data for the year 2015 in one "Universe" .
For the year 2016 I will get the data from another Universe, which will get refreshed everyday.
I am doing an analysis where I need to compare the 2015 and 2016 data together.
Experts, please let me know if there is way to append 2015 and 2016 data using queries created by two different universe.
The data for 2015 remains constant, the data for 2016 should get append as soon its refreshed. Please advise if there is a way to append this data.
Thanks,
Ganesh
You can merge these two queries, similar to a SQL Union, even if they're based on the same data source.
On the report level, highlight and right-click the dimensions that are the same (date --> date, id --> id) and merge them individually.
Measures cannot be merged, but you can create an overall variable to add them together. Right-click on the 'variables' folder on the side, and type in a formula for a measure, like so:
=[Domestic].[Revenue] + [International].Revenue
Then, just drag and drop your data objects (merged dimensions and variable measures) onto your report.
This is assuming you're using WEBI.