VBA to drill down specific data on Pivot Table - drilldown

I am trying to get code so that by pressing a button, users can download certain source data from the Pivot Table. I have a PT set up that is controlled by slicers, so the PT size changes depending on what is selected (customer, date).
I have tried to record a macro, but when I double click the data I want to see, all the macro records is the cell reference, so this wont work if a different customer is selected.
I have attached some images which I hope helps demonstrate what I am trying to achieve.
Is there code that can do this? If so, can I get an example so that I can try to make it fit my working model?
Thank you
Raw data view
Pivot Table
Drill Down 1 e.g.
Drill down 2 e.g.

Related

How to create a pie chart for yes and no answers in Spotfire and not display the Percentage of Yes/No?

I am trying to create a Pie chart as markers in Spotfire map to Show Yes/No answers. How do I do to Display yes and No in pie Sector's instead of Percentage? I am attaching an Excel Spreadsheet with Data with this.
I am expecting to get individual Pie chart for each well in the Spotfire map. For example for WELL_1 Data, the pie chart should have two sectors of two different colors one for YES and one for NO and Sector 1 Should show PRODUCTION, COMPLETION Labels(for yes Category) inside the sector and the Other sector Should show PVT, Image Lables (for no category).
I have tried using the Pie marker option in Spotfire Settings, but not getting the result I am expecting. Any help would be appreciated.
enter image description here.
enter image description here
while Spotfire excels at reading data up and down columns, it's not really designed to read left to right across rows.
you will need to unpivot your table to be tall-and-skinny instead of short-and-wide.
I recommend to start by adding a linked copy of your data table. this way your original table isn't changed, so any visualizations you've already built won't break.
since you haven't specified your Spotfire version, I'll assume you're using 10.x, and my screenshots will reflect that. I'll also be calling your original table Data Table, because I'm lazy and didn't change it in my screenshots ;)
click the + icon in the top left corner
click Other
under "Linked copy to data table in analysis", choose your Data Table
rename the new table to Data Table unpivot to distinguish it, then click OK
from the Data menu, click Transform data...
select Unpivot from the dropdown, then click Insert
configure the transformation
click OK until you get back to the canvas
from the Data menu, click Add calculated column
enter an expression like the following
CASE
WHEN [Category] in ("PRODUCTION", "COMPLETION") THEN "Sector 1"
WHEN [Category] in ("PVT", "IMAGE") THEN "Other"
END
call this column something like Sector
now that you've got the data configured, you can set up the pie chart as needed. here's a sample of that which I put together quickly. I set up the pies on a trellis to illustrate how it might look in your map.

Tableau add formula to dashboard action filter?

I've got a workbook I'm building using public data https://public.tableau.com/profile/alee4645#!/vizhome/JSAClaimantsWardtimeseries/Dashboard1
The basics are working as I want, you see the map, you click on one of the coloured areas and a time series chart appears below the map showing the change over time for that area.
I want to add a couple of comparisons to this data, for example I want the time series chart to show a line for the whole coloured area (Somerset) so people can see how one part of it compares to the overall average.
I have the figures as separate rows in the data but of course when the action filter is triggered they get filtered out along with everything else.
If I edit the action filter in the filter shelf for sheet 2, it has the condition tab and I was hoping I could add [ward code] = "E10000027" (the comparison data I want to use) to the formula box so it would also keep the relevant rows of data, but that stops the chart working altogether.
I could achieve it by getting people to choose an area from a parameter drop down but I'd rather let them click on the map so they don't need to know the name of the area they are interested in.
Can this be done?

Erroneous duplicate rows in BIRT report

I have a problem with a BIRT report I'm working on where I have a nested table in the report. The outer table contains data to do with an item on an invoice, while the inner table contains stuff to do with price banding for labor charges. I've written a separate DataSet which gets the inner data, bound by parameters to data in the outer table. Now, when I preview the inner DataSet in BIRT using the defaults I've given it, it returns two rows of data for that bill number & item number - a normal rate & an overtime rate if you like. When I run the report in full over the same data, the outer table stuff is fine, but the inner table just repeats the same row over twice - it's just the first row repeating.
This is sorta what the table looks like in layout view:
Item Description Rate Quantity Item total
[item] [desc] [rate] [quantity] [total]
...where the price & quantity are in the inner table.
I'd have expected to see something like:
Item Description Rate Quantity Item Total
1 Callout $40 1 $40
2 Labor $30 4.5 $185
$50 1
but instead I get more like:
Item Description Rate Quantity Item Total
1 Callout $40 1 $40
2 Labor $30 4.5 $185
$30 4.5
...even though querying the database & previewing the inner data set based on the same input criteria show the expected result.
Has anyone else had experience like this? I have a hunch it's to do with bindings, but not sure what.
One way to get this behavior is by accidentally replacing a table-level binding with a column-level binding.
For example, define a table by dragging a data set into the report. Select the entire table (use the outline view, or select something in the table and then click on the "Table" button that pops up just below the grid.) Then go to the Binding tab. Note that the data set and column bindings are all filled in.
Now select just one field in the Detail row. On the Binding tab, note that the Data Set is blank, and no column binding is shown. Someone who is confused by this (as I was) might then edit the column's binding and specify the same Data Set that was used to create the table. If you do this you will only see a single value repeated in that column when you run the report. (I believe the overridden column is binding to a second instance of the data set, not the one the table is iterating over.)
Not sure your question can be answered withou looking at the data and the design. But it is important to note that the results you see in the dataset preview, and not neccisarly what you would see if the query was run fully. I have seen difference with 7 records returned. I thought as it was only 7 it would be the same on full run, but it's not. The preview is not just a top 500 query, it has some other (not sure what) filters also.
To problem solve if it is your query or your binding.
If you are using a SQL database. Run the SQL in a SSMS query and see if you get the same results you do when run in the innner table.
Altentively, create a new test report, copy over your dataset and use with a stand alone table.
I think I sorted it, & this is the most bizarre thing: On the child table I'd been deleting the header & footer row & just leaving the detail row in, in the layout view. Last thing today, just before I was going to go home, I tried again - deleted the table for about the 70th time that day, replaced it, re-did the parameter bindings all exactly as before, but this time I left the header row & footer intact. Clicked the preview tab, voila, all shows up correctly. So, since I didn't need the header or footer on the child table, I went into properties, clicked Hide this element, preview again - all good. No difference to the data bindings, no difference to mappings or anything else, no change to the data sets - the only difference was leaving the header & footer in place but hidden.
Contemplating making a bug report, tbh.

Nested table height auto increase?

I am trying to create a report in SSRS using Report Builder 3.0 where there is an ungrouped section of data (in the screenshot this is called "Risks") followed by a grouped section of data "Controls". There can be many controls to one risk row as seen in the row with the "Ref" 3a. After the grouped set of controls it goes back to the ungrouped risk info (see below).
screenshot
I have made this work by using a nested table inside one of the cells, this all looked fine until I added a larger amount of data in the cell "Consequences". As you can see this does not look good at the moment as the inner table does not grow.
My question, is there a way to make the inner table grow, so the 2nd row text would be in the middle of that row and the background colour would take up the whole row, so it does not leave a white space?
I really appreciate any help you can give.
Thanks,
Glenn
I do not believe this to be possible as the nested tablix is by its own right optimised for space and visual appearance.
I know what you want to do and I can only suggest you tweak yourn report to query this data in one and produce one tablix. Not ideal I know as this will mess the arrangement.

How to change the sqlite table structure dynamically in iPhone?

I'm developing an iPad application, in which i have to store some data in the database. So that, i prefer to use SQLite, here i have an doubt regarding the table structure. Let me explain, actually there is a view in which, the user can add the labor Qty, labor type and so on, at default i have displayed only one set of fields.
I have created table with the five fields ( Labor Qty, Labor Type.....) and it works fine. Now i need to setup a button "Add New" at the bottom, i apologize for the low resolution image, when the user click on the button, will generate another five fields below the previous. So how can i get the text fields values into the database table since i have created only for five fields. I tried and googled it but can't find the correct way. Any Help Appreciated. Thanks.
Well in that case what you can do is following.
put your content in UIScrollView
Have the textboxes in UIWebView and upon click on add new create new instance of that.
Put the X,Y co-ordinate in increasing manner let's say first time it is at 10,50 second time 40,50 third time 70,50 and so on,,
also increase X,Y co-ordinates of the button itself.
This way you can achieve above.
Using above logic you can get something like following.