Take the following two scenarios:-
Developer A has created a set of reports:-
Report A shows details of Audi car sales
Report B shows details of Mercedes car sales
Report C shows details of Volvo car sales, and so on for each of 30+ manufacturers.
So we have 30 report files (.rpt).
Developer A has done this so he can assign different security permissions to each AD group of users:-
Group A can only see Audi car sales,
Group B can only see Mercedes car sales,
Group C can only see Volvo car sales, and so on.
Developer B has taken a different approach:-
She has created a single report (one .rpt file) that accepts a 'manufacturer' parameter in order to display the data for any manufacturer.
In both scenarios the reports are loaded from a report 'menu'. In the first scenario a hyperlink for each manufacturer takes you to the relevant report. In the second scenario the same hyperlink supplies the manufacturer name to the single report as a parameter.
The downside with this scenario is the single report file cannot be locked down to a specific set of users. If the report was locked down to Group A, then Group B or C could not view it at all.
Onto the question:-
In order for us to make the second scenario viable we would need a way of checking to see if the current user, or the current users group has access to view the data they are requesting.
I was thinking of using a custom function, something like CheckAccess(Username,Manufacturer) that returns a true or false, and depending on the return value either redirect the user to load the report, or to an error page respectively.
Another option would be to set up roles for each manufacturer, then assign the roles to each group of people. Could a custom function then be used to check if 'Bill' has the 'Audi' role ??
Looking for ideas here as to the best approach.
I suggest you:
Create a table with the userid and report parameter in it. This way the security of the user access can be managed.
Then use the ssrs User!UserID reference as a parameter in your query.
As an added benefit you can create a query to only populate the manufacturers the active user is allowed to see.
Related
Is there a way in Tableau to filter a view based on its relationship with a different variable?
For example, say I have a dataset with variables Company (values = A, B, C) and Product (values = 1, 2, 3). In one view, I want to select a Product. In the other view, I want to filter to only Companies that have that Product, but I want to show all Products for those companies. The typical filtering approach in Tableau could easily show me which Companies have that Product, but the rows with other Products from the same Companies would be excluded by the filter.
Any solutions? I get the feeling I may be missing something simple.
Create a parameter to represent the product of interest. You can load the values of the parameter from the Product field, but will have to add/remove choices periodically as product list changes.
Place Company on the filter shelf, and use the condition tab to choose only companies that have that Product with a formula such as max(Product = [Product of Interest])
For more than one product at a time, create a set of Products instead of a parameter and change the formula to test for set membership instead of field equality. If you have a set of Products called [Products of Interest], note the plural, the formula is then simply max([Products of Interest])
The nice part about a set is that it notices changes to the database Products list automatically. The bad part about a set is that Tableau doesn't make it easy to add or remove elements from a set in the user interface unless you are using Tableau Desktop (at least not by version 10.1)
In addition to the methods explained by Alex, (if you are okay with having multiple sheets) you can have 2 sheets linked with an Action filter -
First sheet would just show the unique list of Products (this acts as the Source sheet)
Second source would contain whatever view you like to show with Companies and their products (this acts as the destination sheet)
Create an action filter between the 2 sheets and use the "Selected fields" under Target filters to filter using the Company field. This way, if you select any specific product(s) in the first sheet, all relevant companies would be filtered in the second sheet but all the products show up too!
EDIT: this is a good solution in many cases, but there are a few things to be careful about.
Note that the first sheet needs Company on some shelf, possible detail, so that field is available for the filter action. If there can be multiple companies per product, then that can complicate the viz a bit.
Working with vehicle asset management and I am selecting data based on two statements:
({EQ_MAIN.PROCST_PROC_STATUS} in ["A", "AS", "AT"] and
{EQ_MAIN.DEPT_DEPT_CODE} like "P*" and
{EQ_MAIN.ASSET_TYPE} <> "COMPONENT")
or
({EQ_MAIN.PROCST_PROC_STATUS} in ["TA"] and
{EQ_MAIN.DEPT_TEMP_LOANED_TO} like "P*" and
{EQ_MAIN.ASSET_TYPE} <> "COMPONENT")
Basically, if the Equipment is in status A, AS, or AT and belongs to the departments that start with P, I want it to show on the report. However, the second part of the selection statement accounts for equipment that is temporarily loaned to another department (status TA). The selection statements seem to be working fine.
I have this data grouped by {EQ_MAIN.DEPT_DEPT_CODE}. But I want it to to include any temporarily loaned out equipment under the department group, if the equipment is on temp loan to said department. For example, Car A belongs to department K1234, but is on loan to department P5678. I want Car A to show up under the group for P5678 along with all the other vehicles that belong to P5678. Essentially, whether a piece of eq belongs to a specific department or is simply on loan to said specific department, I want to see them under the same group in Crystal. Thoughts?
I do not believe that a grouping formula is the solution for this scenario. The challenge is based in the recordset. Since there is only one LOANED_TO record per DEPT_CODE, you can go about this a couple of ways.
If this is an option, modify your query or view so that you generate all LOANED_TO records for each DEPT_CODE. This could be achieved by placing a subquery in your FROM clause if using SQL. Then, join your parent table EQ_MAIN to the subquery on a non-unique, general key. Since there is no one-to-one relationship in this scenario, you should get all LOANED_TO records for each DEPT_CODE. This will, however, bloat your recordset and mar performance.
Then, group the report first on {DEPT_CODE} and second on {LOANED_TO}. Use a suppression formula on the second group to hide any {LOANED_TO} Departments that do not match the parent group {DEPT_CODE}.
The more "traditional" Crystal approach is to group on {DEPT_CODE}. Then, add a sub report to a group section. Using the same datasource, move the second chunk of selection criteria (following the OR clause) to the sub report record selection. This will return all {LOANED_TO} records. Add a sub report link between the group {DEPT_CODE} and the sub report {LOANED_TO} dept. This will filter results to just those {LOANED_TO} records related to the main group.
I'm Using Crystal Reports 14.1. I'm creating a report that has 3 Groups. First group is agency of the company and need separate page per agency. One agency can have more than one building, so second group is building so i need separate page here too. One building can have more than one type of employees, so i need also separate page here. What troubles me is that every group have summaries at the end, which must be on the same page. Sum per agency, per building, per type of Employee. The problem is that if one agency has one building and one type of employee, i need to show those 3 summaries at the same page.
Any ideas how to do this?
in section expert next to New page after click the button labeled X-2.
From there play around with a formula like.
if count({fieldtocount},(summarygroup} > 1
so that if the group only has one record it will not page break.
I have 2 reports displaying data as
Filter Partner Name (Applies only to Report1)
Report 1:
Country Name : XXX
Members Count:1500
Report 2:
Partner name : XYZ
Members Count:1203
On applying filter only to Report 1 : Member count changes
now how can i show the data on Report 2 for the Members Count displayed on Report 1?
Report 2 should have members count that is displayed on Report 1 only
What i'm looking is like a dynamic Count(ID) in Report 2 that changes every time there is a change in Count(ID) of Report 1
on Applying Filter to Report 1
On clicking on bar like above the Data in Report 2 must display only for the (72 members) as Shown Below
How to do this in Tableau 8?
Don't understand, why can't you just apply Partner Name filter to both reports (right click, apply to worksheets,...)?
That way both reports will only display data for the selected partners. You can even build a dashboard with both reports side by side, an put a quick filter so you can select the partners you want to show, and apply the filter to both sheets at the same time.
If this does not work, I'm going to need a little more detail of what you're trying to do, how your database is organized, and how you built the sheets.
I'm using Crystal Reports 10 right now and I have my report almost finished. I have a group of customers and for each customer, I have multiple lines of customer information. The one thing I'm still trying to figure out though is how can I get a running total of one column's distinct values.
So, for example I have a customer Bob who has 6 different items. For each item, there is a manufacturer. It might be the same for all 6 items, it might be one for 3 of them and another for the other 3, or they might all be different. What I want is to have a field at the bottom of the group for Bob that would say:
Man1 - 3
Man2 - 1
Man3 - 2
with the manufacturer being on the left side and the number of items they make for that customer on the right side.
Is there anything in Crystal Reports that can do this right now? Or can someone give me some advice on where I would get started on a formula to do this? Thanks for any help you guys can give.
Need more information:
What kind of data structure are we talking about? How are the manufacturer and item data found? How are these related to the customer? How many manufacturers/items are typically found per customer?
If the manufacturer and items are two different fields, that might be simple (cross tab in customer group). If they are free form, that might be a problem. If there are separate fields for every manufacturer (I've see it happen), then that might be a problem.
Best scenario:
One field for manufacturer, one field for item, distinct relation to customer.
Possible solution:
Group by customer, sub-group by manufacturer, count of items.
Not best scenario:
Table for customer, separate table for each manufacturer.
Possible solution:
Main report, group by customer. Linked subreport on Manufacturer/items.
Worst scenario:
Free-text entry of manufacturer and items in a memo field.
Possible solution:
Redesign your database (grin).
If you have to, you can do this using logic tests through formulas, but if you have many manufacturers/items, it would get exhaustive.
Best answer: More information.