Focal Point
[SOLVED] DEFINE a population

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

November 09, 2011, 06:13 PM
a415
[SOLVED] DEFINE a population
I have a view that shows:
ID     LAW_ALUMNI     SOM_ALUMNI     NSG_ALUMNI
####1      Y              N              N
####2      N              Y              N
####3      Y              Y              N
####4      N              N              Y
####5      N              Y              Y

N's indicate that the constituent IS NOT an alumni of the school. Y's indicate that the constituent IS an alumni of the school. Many alums have multiple degrees in different schools.

I want to make a drop-down list of Population so that a user can choose "Law Alumni", "SOM Alumni", or "Nsg Alumni".... and if Person A is an alumni of multiple schools, then Person A will show up under the school that is chosen.

Currently, I have:
DEFINE FILE WF_COLLEGE
Population/A20=
IF WF_COLLEGE.WF_COLLEGE.LAW_ALUMNI = 'Y' THEN 'LAW' ELSE
IF WF_COLLEGE.WF_COLLEGE.SOM_ALUMNI = 'Y' THEN 'SOM' ELSE 
IF WF_COLLEGE.WF_COLLEGE.NSG_ALUMNI = 'Y' THEN 'NSG' ELSE 'N';
END
...
...
WHERE WF_COLLEGE.WF_COLLEGE.Population EQ '&Population.(<Law Alumni,LAW>,<SOM Alumni,SOM>,<Nsg Alumni,NSG>).Select a Population.';
...
...


Doing it this way doesn't work because if someone is a LAW_ALUMNI and SOM_ALUMNI, they'll only populate in LAW_ALUMNI and never in SOM_ALUMNI because of the order of my DEFINE...

The only way I can see this working is having an OR, but not sure how to phrase it correctly. I'm having a serious mental block with it.

Any ideas on how I can get the DEFINE to work correctly so I can keep the drop-down menu? Confused

Thanks all!

This message has been edited. Last edited by: a415,


8009
Windows 7
Excel/HTML/AHTML/PDF
November 09, 2011, 06:25 PM
Waz
Can you do this...

WHERE WF_COLLEGE.WF_COLLEGE.LAW_ALUMNI EQ 'Y' AND 'LAY EQ '&Population.(,,).Select a Population.'
OR WF_COLLEGE.WF_COLLEGE.SOM_ALUMNI EQ 'Y' AND 'SOM EQ '&Population'
OR WF_COLLEGE.WF_COLLEGE.NSG_ALUMNI EQ 'Y' AND 'NSG EQ '&Population'


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!

November 09, 2011, 07:04 PM
a415
Waz! That was it!! Thanks so much Smiler


8009
Windows 7
Excel/HTML/AHTML/PDF
November 09, 2011, 07:12 PM
Waz
Keep in mind that if you change the parameter to multi select, then all will have to change.


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!

November 14, 2011, 10:49 AM
mpbMDE
Waz:
quote:
Keep in mind that if you change the parameter to multi select, then all will have to change.


What is the "all" you are referring to?
Thanks!


WebFOCUS 8.1.05 Windows 7, all output
November 14, 2011, 03:44 PM
Waz
The sample code will only work on a single select list, not a multi select list.


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!

December 13, 2011, 01:18 PM
DG
how can I make similar work for a multiselect?


WebFOCUS 7.702
Windows, All Outputs