Tableau - Both count and Percentage in Measure Values - data-visualization

I got a sheet that contain stacked bars of 2 measure values like the picture above(It's not mine but it's similar).
My question is, if there is any way to show both count and percentage of each stacked bar.
My data looks like picture below.
Thank you in advance!

While importing data into tableau don't import total column (it is redundant here). By posting your data you have made it clear that you have data reshaping issue. Proceed like this-
Step-1 While importing/connecting to worksheet, click app1 and app2 columns and then pivot them both. screenshot
Rename these fields as per taste. I have re-named these as app name and val respectively.
Step-2 Create a calculated field as
{FIXED [App name]: sum([val])}/{sum([val])}
and build a view like this. (Format calculation1 as percentage)
Good Luck.

Related

missing data in tableau

When I exclude the first column (2017) the data in the second which is now first (2018) goes missing as well.
It looks like you are using a Table Calculation of Percent Difference From If this is the case, the first column will always be blank when set to Table (across).
This is a case where you want to hide the first column, not exclude it. That way Tableau includes the first year in its query and calculations, so that it can then compute the percentage differences client-side in a table calc.
Just right-click on the first column header, and choose hide. The data will be there behind the scenes to support the calculations, but not displayed.

Get result like Excel Pivot Table in BigQuery

I'm trying to get a result like this.
And I have this table right now
Can anyone help me out?
I'd like to get this table by refreshing every day so I can keep up with the result.
Thanks in advance and any help will be warmly welcomed :D
While there are quite a number of pivot related posts on SO and good number of answers are provided by myself and other experts (so you might just need to search more on site), I wanted to share not-trivial option you have to do Excel style pivot right in BigQuery UI without any extra coding.
This can be useful when you have flattened data like in your example - but you need quickly visualize it w/o leaving BigQuery UI
For this to work you need to use Chrome Extension BigQuery Mate (as you can see from my profile I am an author/developer of it)
So, when you have it installed - follow below steps
Make sure you select needed data into result panel as below (i just generate random values to mimic your scenario)
Expand Result Panel by clicking on green + button - now you can see up to 500 rows
Click green Show Pivot button to generate Graph / Pivot from those visible (up to 500) rows of data
Finally, set / tune your pivot / graph as per your needs / preferences - for example as below
To go back to normal UI state - click on Hide Pivot and then -- button

(Excel-VBA) Specific data import (on the background) in the active sheet

Would you please help me (total beginner) to prepare a VBA macro that would open a sheet on the background and import specific selection as shown below:
Let's say we have downloaded wordcount analysis (xlsx) like this downloaded from a CAT tool for testing.
Now I would need to add a macro to my main sheet that would read lines starting (Column A) with "All". If "All" then I'd need to record columns of that line (specficilly Columns A - O) in array / hashtable?.
Please take a look at this image that summs it all (better than explaining it for me :-)
Let me know in case you need to know more details.
All tips / suggestions are greatly appreciated.
Many thanks!
My suggestion (I'm a beginner too) would be to use the Macro Recorder. Great tool to learn (example).
start recording
filter for 'ALL'
copy/past the Cells
stop Recording
Then have a look at the recorded code and adjust it :)
Looking at your data and the final layout you are looking for, using a Pivot Table would provide you with all of the flexibility you need.
You can:
filter which data to display
generate calculated values based on data in other columns
choose what order your columns are displayed
dynamically change the layout if you decide you want a different view
From your data, I was able to generate the following Pivot Table in about 15 minutes.
There are several good, simple tutorials on building Pivot Tables. A Google search will turn up plenty.
Things you will need to learn about for your particular problem:
Classic display (I used the classic display to get this particular layout)
Calculated Fields (many of the columns in the pivot table are calculated based on your spec). There is a maximum string length of 255 characters for a field calculation, so you may need to rename some of the columns in the original data set.
Of course, basics of Pivot Tables
Loading new data and updating your pivot table
Good Luck!

Excel Macro to combine cells of data when data matches in another column

The best way I can explain my problem is by showing a few screenshots.
I need to turn data like this:
[
Into something that displays like this:
After Data
There are multiple part numbers in the file, and I need the macro to take all the data from a matching part number and transform the data into what is displayed in the second image. All the part numbers are grouped with their data together, so it wouldn't need to run the loop through the top every single time, but adding to the entries with each new piece of data. Something also needs to be done for the years as well, because the way the data is presented, is in a range of years, and I need an entry for each year in that range.
Additional Information:
I am using this data for prep for category data for a BigCommerce site, that is working with a year/make/model plugin on the site, to create a vehicle lookup system. Thus in order for the user to look up their vehicle accurately the categories need to be listed the way they are in the second picture, which needs to be the result of the macro.
I thank anyone who takes the time to look into this, it will cut down the time I spend doing this manually by a huge amount.
You can do this with a formula (without actual VBA):
In cell F2 write: ="YMM/"&C2&"/"&D2&"/"&E2&";"
In cell F3 write: =F2&"YMM/"&C3&"/"&D3&"/"&E3&";"
drag down the formula in F3 until the last row.
The last row will contain the entire string of all vehicles.
I just noticed you may have duplicate values. You can use the built in Remove Duplicates feature to remove those before using the above technique.

bind Data table to chart in vb

I have a project that im working on at the moment in VB.
Basically I have a Data Table in VB it populates with 4 columns and a variable number of rows, the column names are as follows;
Gear, RPM, Speed, CO2
The data table appears in datagridview correctly but that's as far as I have gotten :/
What I am trying to do is to make a line chart called mainGraph to draw a graph based on these results, I'm getting stuck when trying to populate the chart.
ANY thoughts would be really appreciated.
I am guessing you are using the ms chart controls and not some 3rd party like Telerik.
This should be usefull http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
Also, there is source code found at http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
in short this is a way to get things displayed
mainGraph.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Line
mainGraph.Series(0).Points.DataBind(yourDataTable.DefaultView, "Speed", yourDataTable.DefaultView, "Gear")
These commands should make a line graph with Speed on your x axis, and Gear on your Y. Assigned to "Series(0)"
To add more columns, you need to add more "Series"
mainGraph.Series.Add("RPM")
Do some thinking about how you want this data displayed.
how would you like to set this graph up?
I'm assuming you would want a line graph?
What is going to be the X axis? Is there a missing column that needs to be "time" in the data table?
do you want them all on one graph/chart area?
If you would like more charts, then you need to add chart areas. A series can be assigned to a chart area.
Hopefully this helps.