[SOLVED]Calculate TOTAL using filter in Master file
Hi All,
May be I am wrong. But I want to know , Can we create a DEFINE/COMPUTE field for storing total of a field using filters in Master file.This message has been edited. Last edited by: Neelima,
You can definitely create a compute field in the Master file. just include the compute logic in the segment for the compute. I don't understand what you mean by "Using Filters". Maybe you want to try using the synonym editor to create some basic samples for yourself.
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
February 07, 2016, 02:06 PM
Neelima
Empid manager_flag Developer_flag tester_flag project a N N Y PROJECT A B Y N N PROJECT A C N N Y PROJECT B D Y N N PROJECT A E N Y N PROJECT B F Y N N PROJECT A
like above, I need to calculate how many employees are manager, developer and tester for particular project.for that, I need to create compute field in MASTERFILE for that,I have tried with DEFINE TOT/D12=TOT.empid; TITLE='Manager Count',RESTRICT = VALUE_WHERE,VALUE = Manager_flag EQ 'Y'; $
the code: RESTRICT = VALUE_WHERE,VALUE = Manager_flag EQ 'Y'; $
is something that you would add as part of the DBA restrictions. From what you are describing, thats not what you are doing. I think you are over thinking this. Just write a simple define.
DEFINE MNGR_FLAG/I8=IF MANAGER_FLAG EQ 'Y' THEN 1 ELSE 0;
Then just agreggate it at what ever level you need it in your query. You could use multi segment master files to do this... but chances are that you don't need that. I would just keep this simple for now.
TABLE FILE MYTABLE
SUM EMP_FLAG
BY PROJECT
END
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
February 09, 2016, 07:27 AM
Neelima
quote:
EMP_FLAG
Thanks Eric,
I have already done this code in my master file but it is not giving me the correct result.
I have to count distinct number of employee by project.