I'm a new BIRT user, and I've been having trouble trying to get the behavior I want for my report. I've created a vertically-oriented crosstab with row groupings on month + year. However, each grouping has completely different columns and this ends up with a lot of empty space. It looks like this:
Note all that empty space. It makes the report end up being huge, horizontally. I'd like it to be closer to something like this (quick mock-up):
Right now, the report is generated based on start and end date report parameters, and it looks fine with just one month. I was thinking I could have the crosstab in its entirety be repeated, each one with its own single-month time period, but I cannot find any way to do this. Would that be the correct way of doing this? Is there a better way?
I figured out how to do it. I made the crosstab a sub-report of a scripted dataset of time periods, and then filtered the crosstab on those time periods. Feels sort of hacky and I gotta think there's a better way of doing it, but at least I've got what I wanted.
Related
Truth be told I'm not entirely sure what it is I'm trying to do here, well, that is I know what I want to achieve, but not how to go about it... so here's hoping you can help point me in the right direction!
I need to create a Crosstab report which has customers down the side, dates for columns, sales for figures. Simple enough.
Where it gets tricky is that they then want another row beneath the customers which singles out two customers, and their sales for one particular product.
They then want another row which will remove that figure from the total of the overall sales total for the first section (see example image).
I'm not really sure where to even start with this. I think I may need to use a query union, but every time I start I get kinda stuck... help!
That's not a crosstab. The summary calculations don't work. It's probably going to end up being three crosstabs formatted to look like a single crosstab. The first crosstab is everything down to the Total line. The last two lines are each crosstabs. Set the Size & Overflow, Padding, Margin, and other formatting properties so everything is layed out, bolded, and shaded the way you want.
You can create this as a crosstab
If you are okay with setting each customer as a fact
You can add them to a crosstab in any order you want
Then you can create a new data item and use a conditional statement that sets the metric to be the specific customers the consumer wants
For example,
IF([Customer] IN(?PrmCust) Then([Sales])Else(0)
For the revised total, unlock the report and replace them with layout calculations that take the total and reduce it by the amount of the selected customers
I have a table of numbers that represent hours worked each day by several employees. Each cell is one day for one employee. Some cells include an "*" character denoting that those hours do not contribute to the departmental total. When calculating the departmental total, I simply do a sum of all the cells and calc ignores those values that include the asterisks. However, when I calculate the sum of the hours for the individual employee, I want to include those hours.
After doing some experimentation, I've arrived at the following clunky formula:
=SUM(VALUE(SUBSTITUTE(C22,"*","")),VALUE(SUBSTITUTE(D22,"*","")),VALUE(SUBSTITUTE(E22,"*","")),VALUE(SUBSTITUTE(F22,"*","")),VALUE(SUBSTITUTE(G22,"*","")),VALUE(SUBSTITUTE(H22,"*","")),VALUE(SUBSTITUTE(I22,"*","")))
While this works, it's terrible! Is there a way to iterate a set of functions over a set of cells? Something like:
=SUM(ITERATE_FUNCTION(VALUE(SUBSTITUTE(X,"*","")),C22:I22))
Or is there an easier way to accomplish my goal?
Thanks!
For Calc, there is one super-power function for working with multiple values: SUMPRODUCT. With a little creativity, it can do just about anything.
=SUMPRODUCT(VALUE(SUBSTITUTE(C22:I22;"*";"")))
It acts as an array function but Ctrl+Shift+Enter is not needed, making things much easier.
I believe this will work:
=SUM(NUMBERVALUE(SUBSTITUTE(CONCATENATE(D22:I22),"*","")))
Press CTRL-SHIFT-ENTER when you're finished typing it in so the formula becomes an array formula, the formula will then look like this:
{=SUM(NUMBERVALUE(SUBSTITUTE(CONCATENATE(D3:H3),"*","")))}
In my report, I have 1 Tablix and 40 columns, i am simply dumping my data into the report, Scenario is as follow:
First row is for heading of the reports.
In Second row, i have data bound columns.
In third row, SUM expression.
I have some 5000 rows in my data table, This scenario is taking around 18 seconds to render the report.
Now the problem is that I need to apply colors dynamically eg.
=iif(CellValue >= 0 , "Black","Red") to all of my columns. as soon as i have applied this expression, report took around 5 mins to render.
Kindly share you expertise.
Regards
Inderjeet Singh
Sometimes SSRS has a bit of trouble doing lots of calculations during rendering. One thing to try is to have this calculation done as a column in the SQL if you can. Then simply refer to this field to determine the color. If you can't do that, add a calculated field to your dataset so that the calculations are done at a higher level than cell-by-cell. That usually helps too.
Based on my personal experience I have found that adding filters within SSRS tends to slow it down. Based on your dataset though it should not have much problem.
Additionally, if you have a grouping set to display pages on a single page (i.e. Keep together) that will slow it down as well.
I'm trying to get a formula that will break down the amount of times a user enters a contest each day.
I'm pretty new to this whole thing, basically putting it together using google to figure out the code I need to use/modify. Explaining why something works would be greatly appreciated so I can use it elsewhere!
Here's a dummy of the form I'm banging my head against.
I would like the form to be reusable, so on the Sorted form I have a date key that automatically fills out the week when you choose the first day. Because of this, I would like each formula to refer to this date key, instead of manually typing the google equivalent of 'February 1st, 2015' into the formula.
I've tried to use the SUMIFS formula, and I've run in to a few errors.
Apparently both pages have to be the same amount of rows, otherwise I get an 'Array arguments to SUMIFS are of different size'. I didn't want my 'sorted' sheet to be 1761 rows long, since all of the duplicate names will have been condensed and I wanted it prettier. Nuts to that! Guess I can hide the rows? Is there any other solution?
It looks like this works:
=SUMIFS(Entered!E3:E1000, Sorted!E3:E1000, Sorted!$E3, Entered!A3:A1000, date(Sorted!$C7))
Where entered!E: is the number of entries, sortedE: is the list of usernames, and E3 is the specific one I'm looking for. Then EnteredA3 is the list of dates and time, and Sorted!C7 is the specific date I'm looking for. I don't get any results!
If I click on my C7 and sorted!A, the little calender pops up, which means they are dates (I think?). One includes the hours:minutes:seconds and the other doesn't, which I think is my problem. I would like to have sorted!C7 be the entire day, and filter out all of those entries.
This is taking information entered via a google form which I won't have control of, so I can't really change the H:M:S additions to the date column.
Thinking ahead to day 2 and onwards, will the same formula work when sorted!C10 is C$7$+1? Is it not a date anymore?
I would also like to add up the amount of daily entries, in sorted!S7 and below. I've tried wrapping both the column of dates and the date from my day key in the date() thing, but it doesn't seem to work either.
=SUMIF(date(Entered!A3:A),date(Sorted!C7),Entered!E3:E)
It gives me a '1', and I have no idea where that comes from.
I haven't been able to find much about the google SUMIFS function, mostly how to replicate it from before it was a thing.
And for even MORE complexity:
I was wondering if it is possible to have UNIQUE find the IDs in entered!C, and return all the associated usernames. That pesky angelo changed their username to 'pants' midway through the contest, and I'd like to be able to see both names and add up both 'angelo' and 'pants' entries in the same line in my formulas.
I feel like I'll need a few hidden columns that have the UNIQUE ID number and the associated usernames that I pull into my Sorted!Username column, but I don't know how to search the IDs to find the different usernames.
I tried to google that, but I have no idea what I'm googling.
Whewph! That is a lot of questions, thanks for any help!
Too long for my taste, but you might try:
=sumifs(Entered!E:E,Entered!A:A,">="&$C$7,Entered!A:A,"<"&$C$7+1,Entered!B:B,$E3)
in Sorted!F3 and copied down to suit.
Oh my goodness, you are a hero!
My final code wound up being:
=IF(ISBLANK(Sorted!$E3)=TRUE, "", sumifs('Entered'!$E:$E,'Entered'!$A:$A,">="&$C$7,'Entered'!$A:$A,"<"&$C$7+1,'Entered'!$B:$B,$E3))
I changed the start and end points by making $C$7 into $C$7+1, and the ending one into +2. (In case anyone else is looking at this answer.)
I'm super pleased that it worked!
Using this I managed to add up each of the daily entries, just by adding up the columns they were in.
I gave up on the UNIQUE idea, if someone changes their username during the contest, then they can add up the two rows themselves.
Thanks again! I'd upvote you, but I can't yet.
I have used iReport to create a simple JasperReport which I run on a JasperServer. It queries some fields from a number of MySQL tables based on their creation timestamp. I am providing the start and end timestamps of the period to cover in the report as parameters of type java.sql.Timestamp. This works fine.
I was asked to introduce the ability to show a break-down on weeks or days of the report data. I would like to get some ideas on where to start with this. At this point I don't think I can accommodate this 'break-down' in the report query, since this feature seems beyond what SQL is designed to do. I know this sounds like an OLAP drill through, but I would like to avoid OLAP if possible (steep learning curve, tight deadlines).
My first thought was to create a subreport for each week or day . But this would leave me with an arbitrary number of subreports (depending on the overall time period covered by the report, which varies at each execution), and as far as I can tell iReport does not support this.
Here is one way to break the report down.
Create another parameter, groupby, which holds the a value that designates the grouping requirement. The values can be numeric, string or whatever else as long as it corresponds to day, week, month, etc.. grouping available.
Create a report group, breakdown, which will provide the breakdown. The group expression will depend on the groupby parameter. The expression is the date on the record except any detail finer than groupby value will be trimmed.
Create a variable, total, that will sum the data in the records. The variable should be reset on breakdown group and can be printed in the breakdown trailer band.
Make sure the sql queries sortby the date so that the groupby expression works.
Let me know if you have questions.