Creating Pie Chart in iReport (4.6.0) - charts

I need help making only one (complete) Pie Chart show up when using GROUP BY in my query (SQL) using iReport 4.6.0.
I need to create a report using iReport (4.6.0; I am using the standalone version, not the NetBeans Plug-in) using data pulled from an SQL database. Basically, I'm trying to create a Pie Chart of what percentage of people in the DB are male and what percentage are female.
At first I tried doing two separate queries to extract this information:
SELECT COUNT('person_id') FROM 'table' WHERE 'SEX' = 'M';
SELECT COUNT('person_id') FROM 'table' WHERE 'SEX' = 'F';
I tried putting both of these queries into the Report Query dialog box, but iReport apparently only handles one query at a time. I also tried using UNION.
I then attempted (and am currently using):
SELECT COUNT('person_id') FROM 'table' GROUP BY 'sex'
This has given me limited success. It creates the chart that I need, but also creates additional, superfluous charts with only part of the data. It appears that each time iReport hits a new "group" from the query, it creates a new chart with the information with that group's data in addition to any data from previous groups (ie. in this case, it created 2 Pie Charts, one which showed only the female members of the DB and one which showed both male and female members). This theory was also tested by adding a new category in the DB (M, F, U) to see whether it would create 3 charts; it does (first with just female, second with male and female, third with male, female, and unknown).
The chart which interests me is the last one, the one which shows the data from all the groups. Can you guys help me in figuring out how to get only that last, complete Pie Chart?

Put the chart in the Title or the Summary band. Make sure its evaluation time is set to 'Report'.

Related

Can you add data to a Cognos 10 bar chart?

Is it possible to dummy code a number to appear in a bar chart in Cognos? I am looking at department expense totals for 2015 and 2016 and want to put a 3rd bar for what the budget for the department is. This data is not loaded into our data warehouse though so I am searching for a possible work around.
Thanks!
If you to have one set of bars, then you have to use a union:
Create a new query
Add a new data item to hold the budget value
Add 'dummy' versions of all other columns. The data types have to match your existing query
Make sure that the order of all columns matches up with the order of the original query
Union your new query with the original query
Use the query representing the result of the union as the source for your chart
Another option you have is to use a baseline to represent the budget. Instead of a separate bar, you have a line that goes across the whole chart at the budget value. Baselines can be configured under the Chart Annotations section of the chart properties sheet.
Lastly, you can choose a chart type that accepts multiple measures.

Creating a chart with Bluemix Embedded Reporting

Using IBM Bluemix I created an app, a Cloudant NoSQL DB, a dashDB and an Embeddable Reporting service. In dashDB I created a table with a couple of columns and some simple data. Next I configured the Embeddable Reporting service and pointed it to the Cloudant DB for its own storage and dashDB for reporting data. Next I open Report Studio and create a chart mapping in some data:
When I play the report page, I get an indication that I have not supplied data:
However if I create a different report and ask for a List ...
The list appears just fine ...
I am at a loss to understand why my chart will not appear but my list will. I will be happy to amend and update my question with any relevant information anyone may need.
Imagine a vertical column chart. Now imagine data of the form:
Dallas 10
New York 30
San Francisco 50
We can easily imagine the cities on the X-Axis and the values on the Y-Axis. This is easy enough. But now imagine that our X-Axis rows in our data are not unique ... for example:
West-Region 10
East-Region 30
West-Region 20
What then should the "value" of the West-Region column be? The column names should be unique and hence we can't have two columns with the same name. Should the value of the West-Region be 30 (the sum) or 15 (the average) or something else?
And that is where the problem comes in. When we define a column in a chart, there is no defined Aggregate Function. What we need to do is define how we want values to be aggregated together. If we select the column and select its properties, we can find an Aggregate Function option. We can choose a function such as Average.
Once defined, the chart will show up correctly because it can now properly handle aggregation. Now, this might seem strange especially if we know for certain that there is never a need for aggregation because values are unique ... but apparently, these are the rules (for better or worse) and, once set, charts now show:

Showing comparison across groups in tooltip Tableau

I have a dashboard that lets users compare a company selected from a drop down menu (Company A) to another company chosen from another drop down menu (Company B). This then displays stacked bar charts (5 categories) by year. I want to build a tooltip so that when the user hovers over one of the 5 categories in either set of bar charts, it shows a comparison of that category between Company A and Company B. Is this possible, and if so, what is the best way to do this?
My previous answer showed a different approach for the problem without using too many workarounds. This answer will try to give exactly what has been asked.
First thing to understand is that you can't have the values for two different companies if you're filtering to show only one company. That means you'll need to circumvent this by filtering directly on the field.
Step 1: Create the new parameters that will be used as filters.
You want to create two parameters called "Company 1" and "Company 2" that will be used in each view to filter the company on the graphic.
Step 2: Create the new measures with the filter directly in the field.
Now you should create two new measures from your main measure, each one filtering one of the companies accordingly to the parameter, e.g. Sales Company 1 and Sales Company 2.
Step 3: Create a field with the variation and add it at the tooltip mark.
Simply enough, you want a calculated field with the difference between them:
SUM([Sales C1]) - SUM([Sales C2])
Step 4: Update the views and dashboard
Change the measure in each of the views for their following specific measure field, and remove the Company filter. And in the dashboard, substitute your usual filters to the parameter (which will be used to filter both views).
By assuming you have a dashboard with two views, you'll be filtering the [Company] in both of these views, making the value of another company not available to be shown at the tooltip.
If you're not using it yet, you could try a new approach and see the variance between companies by using the Color mark. By adding the [Company] as color, you could turn the Stack Marks off and add the second company in the filter to be able to visualize the difference.

Tableau, color-coded bar chart not working

Public workbook here. Source is Excel file.
I was able to create ordered bar chart based on (1) Location (2) Product
When I drag Above Three into Color, the graph is incorrect, how to troubleshoot?
Update
I made change such that Calculation computers based on Product, Above Three for each Location, at level Product.
However, Morton's still shows error.
The order in Mortons should descend, based on number of records, i.e.
Dark Chocolate
Beer
Toffee
Coffee
Fries
Rest of the Locations are correct, but only Mortons gives out-of-order products
Update2
Calculated Field Calculation3 = Index()
And I filter Calculation3 for 1 to 3, to display top 3 products
If I remove Calculation3 from filter, it gives correct order but it give ALL products, not the top three popular products (per Location).
I updated workbook to illustrate this. Please advise.
I don't know the purpose of the Index() field but that is creating your issue. Remove it from rows and the color appears to work the way you want it.
I hope this is what you are looking for
I have also published the file at the below address. You can take a view on that.
Tableau Wokbook
I achieved it by the following methods.
I changed the Calculation 3 field from Index() to RANK(SUM(NUMBER OF RECORDS)).
The calculation 3 was kept in between Location and period then edited the table calculation of calculation 3 by keeping the Addressing of the edit table calculation, having only the location and product as shown below and then Set the restarting every to Product.
You can check the workbook for more information

Tableau Pie-Chart with Measures

I have data with many measures values for each SiteID, i.e.
Total Windows Total Mac Total Online Total Offline Total Computers SiteID
I have been googling how to create pie chart in Tableau, but these tutorials assume I have data that looks like
OS Status SiteID
What I am ultimately trying to do is create a pie chart of online vs offline users and use actions from other data points to filter that chart.
I just need to know how to create pie-chart and from there I can create action.
If I understand your question correctly, it sounds like you want to make a pie chart showing online users vs. offline users, and be able to filter it by SiteID.
You could do this by:
Go to Marks and select Pie.
Drag [Measure Names] into Color.
Drag [Measure Values] into Angle.
Remove all pills except for [Total Online] and [Total Offline] from the Measure Values card.
Then you can create a SiteID filter by creating a quick filter, dragging SiteID to the filter card, or using an action from a dashboard.
Sounds like you need to reshape your data. Can you use SQL to do so?