I have categories (row header) and each category has a sub category (gender), broken down by age range (column header). One of the categories can be divided into two sections and each of the sections would need a subtotal.
The dataset for the table would retrieves information from a MSSQL view which returns the category, gender, and age ranges (the count of each).
A method which worked so far but seem very inefficient is to create datasets (along with a tablix) for Category 1-2, 3AB, 3CD, 3Total, 4-5 and a total. Then align each tablix close to one another so when previewing the report, it would appear they all belong to one grid. I would like to explore other possibilities to achieve this outcome.
Example in excel of how it should look
Thank you for reading
edit- Thank you Sean for pointing it out I need to be more clear. My actual question is how can I include a subtotal and total row in the middle of a dataset of certain categories, efficiently?
Looks to me like a simple row/column grouping tablix.
Modify your dataset to return "category, section, gender, age range, count" and then create a tablix with category->section->gender row groups and a single "age range" column group. For those categories without a section, just return a sentinel string value of some sort, e.g. "All" or the category again.
If you aren't familiar with nested groups, start by adding gender, then section, then category (child to parent) as I find this the most intuitive way to teach people about adding groups.
Related
I have a table that shows the recurrence of purchasing a product, with the columns: product_id, report_date, quantity.
I need to list in a table the products that are more than 50 days unsold. The opposite I managed to do (list those that were sold in the last 50 days) but the opposite logic has not yet been able to implement.
Does anyone have any tips?
An example of the table:
product_id,date,report_date,quantity
329,2019-01-02 08:19:17,2019-01-02 14:34:12,6
243,2019-01-03 09:19:17,2019-01-03 15:34:12,6
238,2019-02-02 08:19:17,2019-03-02 14:34:12,84
170,2019-04-02 08:19:17,2019-04-02 14:34:12,84
238,2019-04-02 08:19:17,2019-04-02 14:34:12,8
238,2019-04-02 08:19:17,2019-04-02 14:34:12,100
238,2019-08-02 08:19:17,2019-08-02 14:34:12,100
238,2019-10-02 08:19:17,2019-10-02 14:34:12,100
170,2020-01-02 08:19:17,2020-01-02 14:34:12,84
170,2020-01-02 08:19:17,2020-01-02 14:34:12,84
There are many steps to do this task. I assume the date column is the one to work with. Your example from table includes duplicated entries. Is it right that at the same time the order is there twice?
So here are the steps:
At first add an calculated field date_past to your dataset:
DATE_DIFF(CURRENT_DATE(),date)
To the dataset add a filter SO_demo with:
include date_past<30
Then blend the data with it self. Use product_id as Join key. Only the 2nd dataset has the SO_demo filter. Add to the dimension of this dataset the calculated field sold_last_30_days with the formula "yes".
In the table/chart to display add a filter on the field include sold_last_30_days is Null.
I am building a scheduling tool for my company. The structure of my Google Sheets document is a summary page with the entire schedule laid out for each employee in each department. Then, each employee gets their own sheet. In each employee sheets I have a section for Sunday, Monday, and Tuesday (the days each employee works). In each section by day I have a column indicating the hours they are on the clock, and then a column for each department. I have placed a checkbox into each cell and can activate the check box to indicate that this employee will be working in that department at that corresponding time. However, there are times when an employee is in a department more than once per day, meaning that the column with the checkboxes has, for example, checks in the cells corresponding to 7am-10am and 2pm-5pm, with unchecked boxes in the cells corresponding to 11am-1pm.
I have query functions that can pull the start and end times in that department if the employee is only in that department once per day. The output, after some concatenation, is something like "7AM-2PM".
=QUERY(A4:C17, "Select MIN(A) where (C=TRUE)")
=QUERY(A4:C17, "Select MAX(A) where (C=TRUE)")
However, I cannot think of a way to discriminate multiple start and end times. Using the above example, I'd like my output to be "7AM-10AM" and "2PM-5PM". These can be in separate cells or the same cell, doesn't make a difference to me. There can also be formulas in several cells if a subsequent formula needs to operate off a previous one.
I hope this makes sense in the way I have described it. I have been struggling for weeks trying to come up with something and am running out of time. Thanks for any and all help!
try:
=ARRAYFORMULA(IFNA(TEXTJOIN(CHAR(10), 1,
TEXT(FILTER($A4:$A17, IF((B4:B17=TRUE)*({FALSE; B4:B16}=FALSE), 1, )=1), "hh:mm\ - ")&
TEXT(FILTER($A4:$A17, IF((B4:B17=TRUE)*({B5:B17; FALSE}=FALSE), 1, )=1), "hh:mm"))))
I think this might be very simple.
I wrote a query in heap to tell me which users were part of an event and how many times they engaged in it during the year.
The result is a simple table with username and number of occurrences.
It worked. However, Heap has this weird behavior of choosing multiple results (maybe at random?) and throwing them into a single "Other (X other results)" category. Where x is a number of others.
So i end up with a table of 20 maybe 30 users and occurences, and one row of "Other (X other results)".
I shrunk the query to see results from a smaller subset of dates and the "Other" category disappeared.
I really need to see every individual row in my query results! Even if it's paginated.
Help! Thank you
You can export the result as a CSV. The downloaded file will contain all the results (all single entries without the grouped OTHER).
Inte the current UI, you can find Export to CSV at the top of the report view.
Imagine a one-table query that accepts a year (range) as a parameter and then yields a dataset grouped by State, City, and Month, with a count of UFOs, if any, for each month.
Tie that dataset to an SSRS Tablix, with a crosstab layout:
The Row Groups are State, City;
The Column Group is the Month (Jan through Dec); and
The row-column intersections are the # of UFOs sighted, if any.
PROBLEM:
If I run the (parameterized) report for one location, even one with few sightings, all goes well: I see columns only for months with sightings.
However, if I report more than one location (say, "Albany," with daily sightings, and "Troy," with October-only), Troy's grouping will come out ugly: If reported alone, just the October column would show, but, now, October along with 11 columns of "#Error" for the month name and a "0" for UFO count appear.
I suspect that one solution may involve some 0- or NULL-fill of missing-month data for Troy and other cities (How?), but is there some other way, via the Tablix widget, to achieve the desired result?
I don't understand what you're doing wrong but the matrix usually works with filling the headers correctly and leaving blanks where there is no data for a single group.
It might help if you show your design view.
Design View:
Report View:
Many of the users don't have data for previous months but at least one does so the month is displayed in the header. The blanks are where there is no data for that month/user combo.
I don't see why your report isn't working like this. If I only selected one user, then only the months that user had will be displayed.
I'm just starting with Reporting Services so please take that into consideration.
I'm trying to make a report that groups by Nominee. I also want to group by Nominator i.e. so that if a Nominee has the same Nominator twice then it displays only ONE row instead for two and it increments field Number of Nominations (I get I need to use COUNT() here) and adds the total points of both (which I suspect I need to use SUM() on).
This is my table (on top) and the one I want to display on the bottom.
http://i.imgur.com/DZNoB.png
Notice on the top table that Janine and Rose have 2 different nominations with the same Nominator, therefore on the bottom table they display counts 2 on number of nominations and the sum of the points for both of the nominations.
So far I've tried this:
http://i.imgur.com/LPyiY.png
How can I make it so I can include name, Dept, points and number of nominations in between groups? I've tried inserting text boxes but it doesn't work. Is there a better way to do this?
Also I'm using a Tablix
Just create one group by option that takes the Nominee Name / ID, and display the name.
Within the details section add each nominator name. In the footer of the Nominee Name group just add =COUNT(Fields!NominatorID.Value)
It would end up with something like this: