Limit PivotTable Filter based on another filter - vba

I have a pivot table with multiple filters, such as:
Site: select one of the sites
Supervisor: shows all supervisors, regardless of site
Currently, the Supervisor filter shows all the available options from the data set. I want it to only display the supervisor names that match the selected site. I'm trying to put together an automated solution that will update as users select the options they need within the filters (to see their site and individual teams, for example). I'm trying to automate this, so it will always be current as supervisors are added/removed from the data set.
I'm pretty sure automating this is a VBA issue, but I'm pretty new to using VBA, so I'm not sure where to start.

Seeing as I'm new and do not have enough rep to comment I will just give you an answer and if it's not what you're looking for I will remove it.
I don't believe this is a VBA issue. In the pivot table Field List you will want to set Supervisor to be filtered by clicking the little downward arrow beside the field name within the "Choose fields to add to report" box. That way when you select a site you can then filter out any of the supervisors that don't belong there.

Related

How to condition an APEX LOV when using APEX_ITEM to create a dropdown list within an interactive report?

Hi everyone I am having a bit of a difficult time even trying to find articles on apex collections and the apex_item functionality but was wondering if anyone has any experience on how to condition a LOV when the the select list has been generated using APEX_ITEM.SELECT_LIST_FROM_LOV.Im still pretty new to using this functionality so I hope this does come across well and makes some sense!
I am currently using Apex 19.1 with oracle database 12c!
We have an apex app we are building and our users want the app to allow the user to pick the number of rows as the number of rows needed can vary for each user, so we achieved this by creating a page item that allows the user to select a number from 1 to 50 - this then generates an interactive report based on this number where the user can then select a further options within 3 select lists as shown below.
We have shown this concept to the business and they really like how this all works. They have identified a requirement where they would like these select lists to then be conditional before the selection is then passed into apex_collections so that when the 'Export From' option is selected it will only allow the user to see the countries that are available within the 'Import To' select list. Furthermore once the country has been selected they want the 'Depot DST' option to only show the available options for the selected country.
I have attempted to look at the select query within the shared component LOV for the application and change this around but I assume because there is no page item associated with the selected values that this wont work as the select list keeps going blank when testing out any changes I make. Any help or advice on how to achieve this would be greatly appreciated.
Regards,
Helen.
have you tried this:
under columns of your report select the column you want to be conditionally filled, when select on the right side of the apex developer look for the List of values submenu and the Cascading LOV Parent Column(s)
there select your parent column and incorporate the column in the where clause of your select for the list of values, pointing at it like this :YOUR_COLUMN NAME

Custom Code to repeat static row on a new group instance only

I have a report where the end user has an input section strictly for in person use. It is a row where they choose "yes" or "no", basically. The issue is that this section is based per group. So, for example, each group is a sales order, that order may have many pages, this "yes/no" section requirement is to only show on the first page of each group.
Note, I have tried to used the Previous function to hide the row, using a field a field from the header section, no luck there. I'm not a programmer by trade and more over don't have experience in VBA
I have exhausted my searches on Google and it doesn't seem like anyone has done this before. It may not be possible because in the row the fields are static texts and aren't referenced from a real dataset.
Appreciate any input or work around that could work, or solidify the fact this isn't possible in SSRS

Displaying rows based on column label in Excel for a Pivot Table

I'm facing the following problem. I have a very large excel sheet in the format attached as a picture. For reasons beyond my control the basic formatting of this sheet needs to be maintained as people with no skill want to be able to edit this.
However, I need to work with the content and as it is quite large, it is really unreadable. So what I wanted to do is to be able to find the tasks belonging to different departments and the different people. My approach was to create two pivot tables where I want a dropdown list with either the department or the person to be able to filter on the tasks that that belong to each of them. I have found how to filter on a dropdown menu, however this is for column entries. What I want to do is to filter on the column labels and then display the tasks for which the column I selected is non empty.
I need some help on the direction in which I need to search for the answer to this problem as I'm currently lost in solutions that have nothing to do with this problem.
Thanks in advance
You can use Power Query Excel 2010+ you can download and activate easily or by default in 2016 version. There you can keep this format for your users and a pivot table for control.

Access 2007 - drop down box in a Report

I need to create a drop-down box so that an employee can select a pre-set reason in the "RE:" field of a Report. There are only two selections that need to be in the box: "personal events" and "lack of adequate notice".
The report itself is already made and there are a number of fields that link back to the database - name, address, specific dates, etc that are already in the report. I've figured out how to make the drop-down box using the combo box function in a form but is there any way I can merge the combo box into the report?
I'm a beginner, by the way so I'm still figuring things out.
Currently your report sits on a query (query get relevant data from the table)
Steps to follow:-
Change the table by adding a column with the two options you just
mentioned above
Add combobox to Form with items as the two options
Adjust your query to use these options as a criteria to change
results returned by the query
Show the results in the report as you are showing right now.
If you have a code already, please post that snippet. So we can help you accordingly.
Some reference for you to get ideas
BUT I HAVE A DOUBT, ARE YOU TRYING TO SAY YOU WANT TO SWTICH BETWEEN TWO REPORTS BASED ON THE USER CHOICE SELECTED IN COMBOBOX?

Determining whether VBA is necessary in Excel, or if a pivot chart/table can suffice

I wish that I had a more precisely descriptive title for this question, but I am not very knowledgeable with Excel spreadsheets or VBA (I'm primarily a Java developer, and don't play much in the Microsoft world).
I'm trying to use an Excel spreadsheet to accomplish something. I need to determine whether I can get there with a PivotTable, PivotChart, or some other built-in functionality... or whether I need to go down the path of writing custom VBA code (or maybe using another platform altogether).
The purpose of the spreadsheet is to help create schedules for an organization (a Toastmasters club). This organization has a roster of members, it meets weekly, and various members are assigned to various roles in a given meeting.
My spreadsheet looks like this:
First Tab
One column... a list of names representing the membership roster.
Second Tab
Each row represents a past meeting date. There are columns for each role, and the cells are to be populated with who served that role on that date. I use Data Validation to have the first tab's roster available inside each cell as a pulldown.
Third Tab (maybe multiple tabs?)
Here's the point of the whole thing. For each of the possible meeting roles, I would like to see which members are the most "overdue" to be assigned for that role. Basically, I want a list of all the club members, sorted in order of how long it's been since they last served that role. People who have never served in that role would be sorted at the top of the list.
Is that third tab data something that can be accomplished with a PivotTable, etc... or am I misunderstanding the purposes and limitations of those tools?
I found a way you can do this with pivot tableS - one per role. It's a bit dubious whether you should, but depends how many roles you have really. I made it work using 2 as a sample, here's the gist:
You have an (Excel) table containing Names
You have an (Excel) table containing Meeting Date, RoleA, RoleB... (I used Chair and Secretary as nominal examples), these cells contain the name of the person taking that role
You then create a Pivot Table for each role (Insert --> Pivot Table). The fields to use are: Row Labels - whichever role you're analysing; Values - Meeting Date
You then change the result type by going into Field Settings, and change it to Minimum. Note that only people who have had that role will show up here.
Repeat this for each role.
Go back to your table of names, and add a column for each role to show when they last held the role. The formula for this is the rather unwieldy:
=IFERROR(GETPIVOTDATA("Meeting Date",Chair!$A$3,"Chair",People[[#This Row],[Name]]),0)
The GETPIVOTDATA will error if they haven't had that role, so I'm replacing errors with 0 (an arbitrary low number)
You can then identify the person most overdue for the role using:
=OFFSET(People[[#Headers],[Name]],MATCH(MIN(People[LastChair]),People[LastChair],0),0)
If there is a tie, the person who appears first in your list of names will be given here.
Hope that makes some semblance of sense, ask away if any questions
My first instinct is to move you to Access where you can SQL query to your heart's content, but I'm sure this can be done in Access without any custom coding.
PivotTables may work, but I avoid them for several reasons (hard to describe to casual users, doesn't update automatically, hard to format, etc.), so here is something using just Excel's built-in cell functions.
Check out vlookup() and countif() on http://www.techonthenet.com/excel/formulas/index.php. (The built-in help files work too. I just like this site more)
In the image below, I have simulated your Tab2 and Tab3. Tab2 is purely data with no equations. Vlookup() requires that this table be sorted by Date Descending and with the date column on the far right.
Tab3 counts both the # times each person has served in that role and when they last worked that position.
The formula in cell C13 is =COUNTIF($B3:$B8,$B13). i.e. it counts the number of times that "Abe" appears in the Chairperson column of Tab2.
The formula in cell D13 is =IF(C13>0,VLOOKUP($B13,$B$2:$D$8,3,FALSE),"-"). i.e. if that person ever served in that role, then it finds the most recent date.
The formulas for security are almost the same. The "Last Served" column is now =IF(E13>0,VLOOKUP($B13,$C$2:$D$8,2,FALSE),"-"). The ranges need to be renamed here to satisfy the needs of the Vlookup function (a SQL query would be really convenient here, but Excel doesn't allow that)
It's hard to define if someone is 'overdue' because some people will argue that "Last Served" is more important than the "# Times Served" and others will argue the exact opposite. I suggest looking at both columns and just talking it over.