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

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

Related

How can I merge duplicate rows in a Spreadsheet while summig the numerical columns?

My Project Reports come from two different sources as we have changed the Project Management tool middle of the year. Therefore, I have prepared two tabs within a Google Spreadsheet with the data from the two systems under same set of headings. Then I combined the two sheets into one using the following query,
=QUERY({'Sheet1'!A1:I1000;'Sheet2'!A2:I1000},"select * where Col1 <>''")
Some of my projects are present within the both the list as they were started early in the year. In order to avoid duplicates I need to merge the two rows representing the same project into one. The project names are identical. However, I need to get the sum of some of the columns such as the 'Time Spent' in order to receive the total value for the whole period. At the same time, columns such as ' Project Owner' are identical among the two rows.
How can I combine these duplicate rows into single rows while merging the selcted columns?
Thank you in advance for your support!
syntax is:
=QUERY({Sheet1!A1:B; Sheet2!A2:B},
"select Col1,sum(Col2)
where Col1 is not null
group by Col1
label sum(Col2)''")
where A column is text and B column are numeric values

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.

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

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?

How to group rows (bassed on CustomerID) using Pivot in SSIS?

I am practicing SSIS and currently working on Pivot transformation. Here's what i am working on.
I created a Data Source (Table name: Pivot) with the following data.
Using SSIS, i created a package for Pivoting the data to have the following columns
PersonID --- Product1 --- Product2 --- Product3.
Here's where am at, I was able to create the pivot data to text file. But The output is not grouped by PersonID.
My Current Output is
As we can see the Transformation does not group the based on
SetKey(PersonID : PivotUsage =1)
The output i am hoping to get is
Where the data is grouped based on PersonID.
What am i missing here?
Edit:
Going back to the example i was following, I re-ordered the input data as follows.
Does the Input data need to be in this order/pattern, every time? Most of the examples i came across follow the similar pattern.
Yes, the input data needs to be sorted by whatever you're pivoting on:
To pivot data efficiently, which means creating as few records in the
output dataset as possible, the input data must be sorted on the pivot
column. If the data is not sorted, the Pivot transformation might
generate multiple records for each value in the set key, which is the
column that defines set membership. For example, if the dataset is
pivoted on a Name column but the names are not sorted, the output
dataset could have more than one row for each customer, because a
pivot occurs every time that the value in Name changes.
That's a direct quote from the Pivot Transformation documentation on MSDN. (Emphasis added.)
When I first read this answer, I thought that the sorted column should be the one with PivotUsage=2 in the pivot. That's what I understood the pivot column to be. However, what finally worked for me was to sort by a column with pivot usage=1. It's a column I would group by if writing the sql by hand.

SQL 2005 Report Designer - Using specific table cells as data in charts

I have various reports built in MS SQL 2005 Report Designer, displaying various sums and counts of different data. Now I need to implement different types of charts in these reports (Bar graphs, Pie charts), using the data from the summed cells (subtotals and grand totals for groups).
I don't see any ways to specify a table cell as input for a chart's data in the chart properties, it gives me errors saying it's not part of the "data region." I can't find any info on how to create data regions, and I assume I don't want to use "data output" because that only deals with exporting xml?
Can anyone give me some direction on how to easily link table group subtotals to chart input data?
Thanks
Different report items (tables, chart, etc) don't have to derive from the one dataset. Just use different datasets for the different report items. Let's say your main report table uses a dataset that shows the invoices sent by different branches, which you sum at the branch level:
SELECT Branch, InvoiceNumber, InvoiceDate, InvoiceAmount
FROM Invoices
ORDER BY Branch, InvoiceNumber
Simply create another dataset for the pie chart being the summary information:
SELECT Branch, SUM(InvoiceAmount) AS BranchSum
FROM Invoices
GROUP BY Branch
you want to create a expression calling on the dataset
=Sum(Fields!InvoiceAmount.value, "DataSet1")
If you want to call on the same Field just use AS in the select statement.
Select
Invoices.InvoiceAmount AS InvoiceAmt
InvoiceAmt will then be a useable field equal to invoiceamount

Resources