Focal Point
[SOLVED] Generating Business Views with Filters, Virtual Columns, and/or Compute

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/999102624

April 23, 2010, 03:04 PM
James at WI
[SOLVED] Generating Business Views with Filters, Virtual Columns, and/or Compute
I have a need to provide a security tailored view of data to my MRE report developers based on column values. As an example, using my employee file; some developers can only see employees from their region, other developers can see all employees but can not see any salary/wage information, others can see all information on all employees with the exception being salary/wage information for manager level and above, and lastly some can see everything about everyone. I know that I could create multiple masterfiles and locate them is separate app/paths, but I was hoping to use Business Views tailored against one masterfile. Is there anyway to filter the data at the Business View level or generate virtual or computed columns? Can this be done? relatively easily? thanks for any and all assistance.

This message has been edited. Last edited by: James at WI,


Release 7.7.03,
Windows platform,
Excel, PDF, HTML,Active Reports, Active/Flex,
April 23, 2010, 06:27 PM
Dan Satchell
Maybe FILTERs will work:

Using Filters, see page 3.

Assigning Screening Conditions to a File


WebFOCUS 7.7.05
April 26, 2010, 09:44 AM
James at WI
Thanks for pointing me to Filters. In researching them it does not appear to give me what I need, or I may not fully understand how to use them. If I can restate my issue; at the masterfile level I want to change the value of the salary field based on these rules; when the user accessing the file is A then the salary is 0, when the user is B and the location field ='MX' and the orglevel field is greater than 5 then the salary is 0, when the user is C and the orglevel field is greater than 5 then the salary is 0, when the user is is D and the orglevel field is greater than 7 then the salary is 0, when the user is E then the salary is the salary.
I was hoping that there was some syntax in the Business View definition that would allow me to do this type of conditional checking.


Release 7.7.03,
Windows platform,
Excel, PDF, HTML,Active Reports, Active/Flex,
April 26, 2010, 05:55 PM
Waz
This sounds like you need to use the DBA option in the Master files. This can restrict acces to columns and data.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 27, 2010, 06:02 AM
Alan B
Business views might work. Try:
FILENAME=CAR_BV, VIEW_OF=car, $
  SEGMENT=FOLDER, $
    FIELDNAME=COUNTRY, ALIAS=COUNTRY, $
    DEFINE CAR/A16 = IF COMP.CAR EQ 'DATSUN' THEN 'NISSAN' ELSE COMP.CAR;
    FIELDNAME=MODEL, ALIAS=MODEL, $

so redefining the field CAR overrides the real field, and also stops the real value of CAR coming through.

Has to be hand coded though.

Also be aware that if you did:
FILENAME=CAR_BV, VIEW_OF=car, $
  SEGMENT=FOLDER, $
    FIELDNAME=COUNTRY, ALIAS=COUNTRY, $
    DEFINE CAR2/A16 = IF COMP.CAR EQ 'DATSUN' THEN 'NISSAN' ELSE COMP.CAR;
    FIELDNAME=MODEL, ALIAS=MODEL, $

then someone could code
TABLE FILE CAR
PRINT COUNTRY CAR CAR2 MODEL
END

which would sort of kill any security; though the field CAR would not be available in the tools, it is accepted if it was coded via an editor.


Alan.
WF 7.705/8.007
April 28, 2010, 10:08 AM
James at WI
I will work on setting up the business views. Is it possible to have business views in different app/path folders that the original masterfile?

Thanks


Release 7.7.03,
Windows platform,
Excel, PDF, HTML,Active Reports, Active/Flex,
April 28, 2010, 02:02 PM
James at WI
I believe that the business view approach will give me what I am looking for. I am having an issue with syntax for the DEFINE virtual column. While the reporting tools (Dev Studio and InfoAssist) recognize the virtual field I get an error when attempting to use it in a report. the error is
0 ERROR AT OR NEAR LINE 6 IN PROCEDURE newfex FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED:
EMPLOYEE_BASIC_SPECIAL.FOLDER1.ANNUALSALARY
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


The syntax in the business view is
FILENAME=EMPLOYEE_BASIC_SPECIAL, VIEW_OF=hr/employee_basic, $
SEGMENT=FOLDER1, $
FIELDNAME=EMPLOYEEID, ALIAS=EMPLOYEEID, $
FIELDNAME=STATUS, ALIAS=STATUS, $
FIELDNAME=COMPANY, ALIAS=COMPANY, $
DEFINE ANNUALSALARY/P21.4=IF PAYGROUPCODE EQ 'EXEC' THEN 0 ELSE ANNUALSALARY; $
FIELDNAME=PAYGROUPCODE, ALIAS=PAYGROUPCODE, $
FIELDNAME=EMPLOYEENAME, ALIAS=EMPLOYEENAME, $


Release 7.7.03,
Windows platform,
Excel, PDF, HTML,Active Reports, Active/Flex,
April 28, 2010, 03:26 PM
James at WI
Using Business Views got me to where I needed to be. Thanks Alan. We will be using InfoAssist for our report development. The final resolution involed defining virtual fields in my masterfile, creating business views, grouping my developers by domain/group in MRE, creating reporting objects and limiting the developers/users to the available reporting objects.


Release 7.7.03,
Windows platform,
Excel, PDF, HTML,Active Reports, Active/Flex,