How to create a pivot table/chart for quarter data? - pivot-table

I am trying to create a pivot table that I can get the top 10 categories by quarter using the table below based on the numbers. In conjunction, I want to make a pivot chart that will allow me to select what quarter I want to show as well. Is this even possible? Thank you in advance.

I'm going to take a guess that you don't have an answer yet because this is poorly tagged?
Anyway, here's a quick stab, seeing as nobody else has stepped up to the plate yet.
If your data was in an Excel worksheet then you could easily make this into a Pivot Table, simply highlight all the data and Insert - Pivot Table. You would wants your rows to be "Category Association", and then you could add "QTR1" to "QTR4" as "Sum of" items to the "Values" part of the Pivot Table.
To get the top 10 per quarter you would need to click the arrow in the "Row Labels" cell and pick "More Sort Options". Then "Descending (Z to A) by:" pick "Sum of QTR1", then "Sum of QTR2", etc. If you want all four at the same time then make four pivot tables. To get the top ten you would either count the rows manually, or use formulae to present this on another worksheet.
You can make a pivot chart by simply clicking the pivot chart button when you have a pivot table selected. You can then select which quarters to include by ticking/ unticking them in the "Pivot Table Fields" section, but note that this will also affect the pivot table you picked to make into a pivot chart. Again, you might need to make a new pivot table to be used for this purpose?
So everything on your list is possible, it's just a case of trying it I guess?

Related

Conditional Formatting on specific columns in pivot table v2 chart in Apache Superset

I wanted to know if there's any way I can apply conditional formatting(coloring) on specific columns in Pivot Table v2 chart in Apache Superset.
Tried:
In pivot table v2 chart when I try to apply formatting/coloring of data it applies on every column of the table in superset application.
Expected:
For example: In superset application I have a pivot table say with columns total orders, canceled orders, allocated orders and i want to apply coloring/formatting on total orders column only. So the total orders column data will only be displayed in colored format.
I am not sure this is possible in pivot tables (without customizing it in anyway, that is)
Since a pivot table shows the same metric (grouped on the basis of 2 or more columns), it might not make sense to show formatting on only one column.
If your pivot table is grouping by only two columns, you might try creating a table that shows the same data as your pivot table. And since you can write HTML in tables, you might be able to color only the column you need

How to manipulate dataset to get information from different tables?

Currently my data is set up as a union of two tables. The red rows are Table 1 and the blue rows are Table 2. I am doing my union in SQL Server and am connecting this into Tableau. I am using Excel right now to depict what I am seeing (left pivot table) more easily and what I want to see (right made-up pivot table).
The current pivot table is showing when filtered on a particular Plant/Project/Product, those are the components that go into the Product and those are the months in which the Products are due to the customer. The values in the bottom row are the quantity of the Product that is due to the customer. For example- in June, a quantity of 1 of the 150-100020-1000 product is due to the customer. The quantities are showing up under a null component because that field isn’t in Table 2, as you can see in the blue rows.
I want those bottom row values to appear under literally any one of those components that are listed. In this case, it’s only showing one set of Plant/Project/Product, but I would want the formula/code to pick up on that too when it’s evaluating what to output. In the example on the right side made-up pivot table, I have the quantities showing up under the component #100, but it can be under any of them as long as the Plant/Project/Product is equal in both tables. I also don't want the blank/null dates from Table 1 to show up, but they are tied to the components so I can't filter them out easily.
I've tried several types of joins and temporarily tables to get this working and keep coming up blank. How can I set up my dataset to get the view I want to see in Tableau?
Dataset and Current View + View I Want
Your problem is you don't have a Component against a Qty. Hence for what you want somehow you need to create a Component. Perhaps this is possible using a FIXED calc, which would create this field across all records. If the value of Component doesn't matter create this calculation:
{MIN([Component])}
This should put 100 against each record.
If you also need to keep the existing Component value, when it exists, try a formula such as:
IFNULL([Component],{MIN([Component])})
Note I haven't tested any of this.

Summing the Non-Null results in a matrix

I have a report that looks like the picture below. It is a matrix with person name on the rows and weeknum on the columns. What I need to calculate is the number of weeks that have data in the calls taken column. In the picture below it is the consistency column with the red numbers. I can't seem to get those red numbers to appear. Is there an expression that can count the number of columns that aren't null in a particular matrix. This report will be dynamically generated and the number of weeks will be totally different each time.
I would rather solve this in SSRS because I don't want to mess with my SQL too much but if no SSRS solution is possible I can post my SQL and perhaps solve it that way.
You need to create a column group outside of the last group. So in your example, Right click on the column tab above your efficiency column in the 23rd week. After you create this column, you can use a simple Count(Fields!CallsTaken.Value) in an expression to count the times there are values listed.
Reference SO question on Horizontal Totals.

Creating a Batch Report

I am trying to create a batch report of multiple invoices using SSRS 2008 R2.
I have created the initial invoice report and have it set up with a parameter; the parameter uses an InvoiceID to populate the data within the invoice report.
I have created another report using lists, inside the list contains the information that was in my original invoice report but using a different parameter (BatchID). The problem I am running into with this is that instead of creating a single invoice for each invoiceID it is creating an invoice for each line item within each invoice. i.e.~ Instead of incorporating multiple items based on the InvoiceID (as the original report did) it is creating a report for each of the items.
What would be the best way of running a batch of these invoices? Am I going about this the wrong way or am I on the right track but missing something?
Thanks in advance!
SELECT i.InvoiceId, i.InvoiceNumber, i.BillTo_Line1, i.BillTo_Line2, i.BillTo_City, i.BillTo_StateOrProvince, i.BillTo_PostalCode, i.CustomerIdName,
i.ce_OutstandingBalance, i.ce_BillToDate, i.ce_BillFromDate, i.TotalAmount, id.ProductIdName, id.ce_customeridName, id.ce_CustomerProductName,
id.InvoiceDetailId, id.BaseAmount, id.PricePerUnit, id.ce_rate
FROM
Invoice AS i RIGHT OUTER JOIN
InvoiceDetail AS id ON i.InvoiceId = id.InvoiceId
Once I enter the invoiceID I get my report
My intent is to be able to run the report against multiple invoicesid numbers without having to select the invoice number itself. I have another table that collects the invoiceid's based on a batchid that they are run in.
So far I have attempted to create a subreport with the original report and Create a separate report that uses a list and attempt to group by InvoiceID for each batchid. Though with each of these I have so far been unsuccessful.
I am new to SSRS and have been pouring over documentation from MSDN about SSRS and the different abilities.
For this sort of repeating list, it's a matter of understanding how a list/grouping works.
Lists, Tables and Matrixes are all the same underlying object - the Tablix.
A List is a Tablix with one detail row (i.e. one Tablix row for each row in the Dataset), one textbox in that row, and a Rectangle in that textbox. The Rectangle can have various embedded elements like more textboxes and as such provides a repeating free-form item for each row in the Dataset.
You can see this when you create a List in the designer:
I assume your report query takes a BatchID and returns a number of invoices and their invoice details. I've taken some liberties with your data and created a simplified sample Dataset:
You want the Rectangle to repeat for every InvoiceNo. Currently the Row Group has no grouping item - change this to InvoiceNo under the Group properties and expand the Rectangle as required.
You can start adding in elements such as textboxes for the Invoice level items, something like:
Note that the left side of the Tablix has changed from lines to a bracket - this is because a grouping item was added to the Row Group.
This will repeat once for each InvoiceNo. Now we want to add the line items - you can do this by dragging a new Table into the Rectangle. Since we have a Row Group in place this table will only display items in that group:
When run for the sample data, this gives an ugly but functional repeating invoice report:
This could be tidied up as required, and page groups inserted between Group items in the Group properties as required.
Hopefully this at least gives you a rough idea of how you might go about your task.

SSRS: repeat tablix left-most row group value on each row

I have a tablix in an SSRS 2008 report. It has two-level row groupings, and I'd like the value for the left-most grouping to continue to be displayed on each row. Eg, I get this:
group1 subgroup1 500.00
subgroup2 250.00
... but I'd prefer...
group1 subgroup1 500.00
group1 subgroup2 500.00
I can't seem to find the option for this. Is it a strange thing to want?
Thank you,
Bill
You can simply edit the upper reporting level, to be grouping on both groups at the same time, this will cause your desired behaviour.
I had to resort to this solution once, where "hide duplicates" didn't seem to achieve the desired result.
It's so simple...you have to right click on the cell in the DATA area (ex. where is displayed the value 500) and to click add COLUMN on the left. After this change the value in the new cell with the label field (subgorup1), also do this for the others columns that you want to add, but remember to do it from the DATA area. when you finish, delete the columns out of the data area, but keep the row groups. nice try!
Currently, what I've found to be a good way of determining whether or not the repeated values of a group would show up in a SSRS report, is to create the Groups and build your report based on the groupings. Secondly, take the groups fields and duplicate the column to the right hand side of the report. Making sure that you've included all the columns needed and totals are correct; delete the grouped columns. When you do this, you will get a popup asking if you want to delete the group or just the columns, chose columns - this will keep the format of the initial report and keep all of the total line as well.
If you select the row in question, there is a field called Hide Duplicates. Set this to nothing (null, space, etc) That should return the values you want.
I had this same issue and I solved it really easily.
It seems you have two row groups, by group and by subgroup.
What you have to do is to select the first column and group by group and by subgroup and remove the grouping by subgroup.
That should do the trick.
Put ROW_NUMBER() OVER (ORDER BY name ASC) AS Row# in each query as a serial number and hide the row in the SSRS Report.
See: https://learn.microsoft.com/en-us/sql/t-sql/functions/row-number-transact-sql?view=sql-server-ver15

Resources