Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] MAINTAIN using a multilist selection to filter a stack
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] MAINTAIN using a multilist selection to filter a stack
 Login/Join
 
Gold member
posted
I have a maintain form with a multilist that is filled using a stack.

I would like to use the selected values from the multilist box as a filter to filling another stack.

So the user selects a few things from that list and hits go; this calls a function that fills a stack as follows (BEG_DT and END_DT are also fields on my form):

For all next readmit_30_day.READMIT_30_DAY.RECORD_ID into stk
Where (DEPARTMENT IN ([selection list]))
AND (ADMIT_DT2 GE BEG_DT)
AND (ADMIT_DT2 LT END_DT);

I'm pretty sure I could fill this stack by passing these values from the form to a fex, then execing the fex into the stk, but I was wondering if there was any way of referencing this list of selected items directly in the where clause in maintain? Seems like a lot of extra work to go with the fex route, as I'm pretty sure I'll have to concatenate all the values into one string and one parameter since I don't know how many items the user might select.

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


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
 
Posts: 61 | Registered: April 16, 2009Reply With QuoteReport This Post
Master
posted Hide Post
This can easily be done with Maintain.

Let's assume that DEPTSTK contains the list of selected departments. We loop through the selected values and load the proper records into the stack one selection at a time. We would do this:

compute i/i3=1;
repeat deptstk.foccount
reposition readmit_30_day.READMIT_30_DAY.RECORD_ID
For all next readmit_30_day.READMIT_30_DAY.RECORD_ID into stk(stk.foccount+1)
Where DEPARTMENT eq deptstk(i).department
AND (ADMIT_DT2 GE BEG_DT)
AND (ADMIT_DT2 LT END_DT);
compute i=i+1;
ENDREPEAT
Stack Sort STK by RECORD_ID

Mark
 
Posts: 661 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Gold member
posted Hide Post
Awesome!

This worked beautifully except for one small thing. deptStk is my display list and thus has all the departments regardless of which ones I selected. I created a second stk, bound it to the selection result of my field, and then used it in the Where statement and I got exactly what I needed.

Thanks Mark!


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
 
Posts: 61 | Registered: April 16, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] MAINTAIN using a multilist selection to filter a stack

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.