Focal Point
[Solved]multi select varible in header

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

September 24, 2010, 01:25 PM
JOE
[Solved]multi select varible in header
I'm looking to show the variable selection in the heading of this report. The variable can contain multiple values from the list box control. I found my answer on this forum, however I keep getting a prompt for &CNTR and &skill0. What am I doing wrong.

Post that has my answer
answer


Thanks for any help

  TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SQLOUT
END
TABLE FILE SQLOUT
SUM
     calls
     acdtime
     acwtime
     holdacdtime

BY EmpDivisionName
HEADING
""
FOOTING
""
WHERE skill EQ &skill.(OR(FIND SKILL IN &skill2)).select.;
ON TABLE SET PAGE-NUM OFF
ON TABLE SET FORMULTIPLE ON
ON TABLE NOTOTAL
ON TABLE HOLD AS SKILLAHT FORMAT FOCUS
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     RIGHTGAP=0.125000,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END
-SET &ALLVAR = '';
-REPEATE ENDREPEATE &CNTR FROM 0 TO &skill0
-SET &ALLVAR = &ALLVAR | &skill.&CNTR | ',';
-ENDREPEATE

TABLE FILE SKILLAHT
PRINT
     calls/I11C AS 'Calls Ans'
     COMPUTE AHT/D6.2 = IF calls EQ 0 THEN 0 ELSE ( acdtime + acwtime + holdacdtime ) / calls;
     COMPUTE AVGTalk/D6.2 = IF calls EQ 0 THEN 0 ELSE acdtime / calls;
 AS 'AVG Talk'
     COMPUTE AVGACW/D6.2 = IF calls EQ 0 THEN 0 ELSE acwtime / calls;
 AS 'AVG ACW'
     COMPUTE AVGHold/D6.2 = IF calls EQ 0 THEN 0 ELSE holdacdtime / calls;
 AS 'AVG Hold'
BY EmpDivisionName
HEADING
"AHT Skill Selection Report"
"Start Date: <+0>&dte<+0> "
"End Date: <+0>&edte"
"Skills: &skill"
FOOTING
""
ON TABLE SUMMARIZE SKILLAHT.SEG01.calls AHT AVGTalk AVGACW AVGHold AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,

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


WebFocus 7.7.02 WinXP
September 24, 2010, 02:26 PM
Prarie
Just glancing - you need to start your counter somewhere

-SET &CNTR=0;
September 24, 2010, 02:49 PM
JOE
Thanks..now I just get a prompt for &skill0


WebFocus 7.7.02 WinXP
September 24, 2010, 03:48 PM
Darin Lee
The first time &skill0 is used, it has not been set anywhere, thus the prompting. The easiest might just be to use -DEFAULT &skill0 = 0 .
That would eliminate the prompting. Otherwise a value has to be declared or calculated previously to its first reference. (Also, the REPEAT/ENDREPEAT commmand shouldn't have an 'E' on the end.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 25, 2010, 12:46 AM
JOE
I think I may need to explain what I'm looking for. What I want to do is replace my multi select variable in my header to read ex. Skills: 1,17,21,45 ect. instead of Skills: '1' or '17 or '21' or '45' ect. Thanks!


WebFocus 7.7.02 WinXP
September 25, 2010, 04:26 AM
FrankDutch
Darin
if you set the default as suggested you still get a prompt
instead you can say
-DEFAULTH &skill0=0;

the H stand for Hidden




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 25, 2010, 02:16 PM
JOE
quote:
Skills: 1,17,21,45 ect. instead of Skills: '1' or '17 or '21' or '45' ect. Thanks!

Is this possible instead of looping out a new variable?


WebFocus 7.7.02 WinXP
September 25, 2010, 08:52 PM
Dan Satchell
A little cumbersome, but here is one way to do it in Dialogue Manager using the UPCASE, PATTERN, STRREP, and EDIT functions. Variable &OUTLEN needs to be 1 less than the length of variable &Skills plus the number of numeric values you expect in &Skills (to make room for the commas being added). I picked the arbitrary number of 10, which would allow up to 11 numeric values in &Skills. If you expect more than 11 values, then you would need to increase the size of &OUTLEN accordingly.

-SET &Skills    = '''1'' OR ''17'' OR ''21'' OR ''45''';
-SET &OUTLEN    = &Skills.LENGTH + 10 ;
-SET &SKILLS_UC = UPCASE(&Skills.LENGTH,&Skills,'A&Skills.LENGTH');
-SET &PATTERN   = PATTERN(&SKILLS_UC.LENGTH,&SKILLS_UC,'A&SKILLS_UC.LENGTH');
-SET &STRING    = STRREP(&PATTERN.LENGTH,&PATTERN,4,' AA ',5,'$$$$,',&OUTLEN,'A&OUTLEN.EVAL');
-SET &MASK      = STRREP(&OUTLEN,&STRING,1,'''',1,'$',&OUTLEN,'A&OUTLEN.EVAL');
-SET &RESULT    = EDIT(&Skills,&MASK.QUOTEDSTRING);
-TYPE Skills = &Skills
-TYPE RESULT = &RESULT

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
September 25, 2010, 09:57 PM
JOE
Good One Dude you rock! Worked like a charm!! Awesome!


WebFocus 7.7.02 WinXP
September 26, 2010, 10:01 PM
Dan Satchell
You can also do it more simply with just the UPCASE, STRIP, and STRREP functions. (Sorry, but since I discovered how nicely the PATTERN function works with EDIT, I am always looking for ways to use it.) UPCASE may not be necessary either, but ensures the word 'OR' is always capitalized. This approach also avoids the necessity to define an output length (&OUTLEN in my previous example), because removal of the single quotes and 'OR's will make more than enough room for the added commas.

-SET &Skills    = '''1'' OR ''17'' OR ''21'' OR ''45''';
-SET &SKILLS_UC = UPCASE(&Skills.LENGTH,&Skills,'A&Skills.LENGTH');
-SET &STRING    = STRIP(&Skills.LENGTH,&Skills,'''','A&Skills.LENGTH');
-SET &RESULT    = STRREP(&STRING.LENGTH,&STRING,4,' OR ',1,',',&STRING.LENGTH,'A&STRING.LENGTH');
-TYPE Skills = &Skills
-TYPE RESULT = &RESULT

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05