Focal Point
Creating WHERE statement for drill

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

January 14, 2008, 02:17 PM
rfosnaugh
Creating WHERE statement for drill
I am trying to generate a where statement a graph fex that will then be passed to the drilldown report as a parameter. I am doing fine with something like:

-SET &compute_where = '( ' | &CLAIM_STATUS_TYPE | ' EQ ~YES~ )';

....

  FOCEXEC=claims_count_detail_rpt1.fex(where_stm='&compute_where'), TARGET='_blank',

....

and then in the drilled report I replace the ~ with ' and have the WHERE statement just be WHERE &where_stm. My problem is that I have not been able to find a way to put values like N1 from the graph into the parameter phrase. If I add N1 to the SET statement it pushes over as N1 no matter what I've tried. I was hoping it would be as straightforward as putting the &CLAIM_STATUS_TYPE in the where statement was.

If anyone has any good tips on how to make things more generic when drilling down I'd be glad to hear them. I've searched these forums until I'm crosseyed, but nothing seems to be lining up for what I'm trying to accomplish. Basically I have multiple graphs that when drilled into will go to one centralized detail report, but each graph will have many different combinations of parameters.

Thanks for your time reading through this. I'm very new at this and probably over complicating matters.

Thanks!

rob


WebFOCUS 8.0.0.5 - SQL Server - Windows Server
January 14, 2008, 03:39 PM
GinnyJakes
Just a quick idea. Take your &var and set it up as a field in a define. Then PRINT/NOPRINT the field in the report. It will then have an 'N' number.

DEFINE FILE filename
DRILL_WHERE/Ann='&COMPUTE_WHERE';
END
TABLE FILE filename
PRINT ...
DRILL_WHERE NOPRINT
...
FOCEXEC=fexname(WHERE_STM=Nn),TARGET=_blank
...  



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 14, 2008, 04:08 PM
rfosnaugh
Thanks for the reply Ginny. It doesn't quite address the complete issue I'm facing though, but I'm sure I'll be using this technique soon.

Where I'm having problems is getting the N1 value into the parameter. Right now for instance I am passing the claim status (new/pending/closed) that is a parameter from the HTML launch page. I then need to also pass the drilldown values such as Claim Type(property/casualty/etc) and Year/Month (2008_01) when a user click on the line graph to drill down into detailed data displaying Counts by Claim Type by Year/Month. If I put N1 into a SET or Define it is just displaying N1 as opposed to &vars which are parsed.

Is there a way to build a parameter string withing the drill FOCEXEC line? Once a space is encountered, it determines that a new parameter is being passed.

Thanks!

rob


WebFOCUS 8.0.0.5 - SQL Server - Windows Server
January 14, 2008, 04:33 PM
GinnyJakes
You can use Dialogue Manager to build almost anything.

You could have multiple focexec drill lines and test a variable to choose which one to incorporate into your code at runtime.

Does this help? It isn't totally obvious to me what you are trying to do. Maybe if you pasted more code?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 15, 2008, 03:17 AM
GamP
Just an idea.
Why not add this N1 parameter (or even more params) as a separate parameter to your drill-down parameter list. Then in the target procedure you can do with it what you want.
Point is, that this N1 parameter will only be resolved when the html-code for the report is being created, You can't do a thing with it in DM, because that is being eveluated before the request runs. And there is no real logic in building the focexec parameter line for drilldowns. As you noted, a space means "oh, good, I've got a new param", so why not use that to your advantage.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 15, 2008, 08:48 AM
rfosnaugh
Thanks both for your comments. I feel like I am in a vortex right now and just needed something to grab onto regarding this drilldown issue. For the time being I will pass parameters to be joined together in the drill fex.

Graph fex.....
FOCEXEC=claims_count_summary_rpt.fex(parm1='CLAIM_TYPE' parmoper1='EQ' parmval1=CLAIM_TYPE parm2='&CLAIM_STATUS_TYPE' parmoper2='EQ' parmval2='1' parm3='COUNT_MONTH' parmoper3='EQ' parmval3=COUNT_MONTH), TARGET='_blank',

Drill fex.....
-SET &QT = '''' ;
-DEFAULT &where_stm = '';
-IF &parm1.EXISTS  EQ 0 THEN GOTO :NOPARAMS;
-SET &where_stm = '( &parm1.EVAL &parmoper1.EVAL ' | &QT | &parmval1 | &QT | ' )';
-IF &parm2.EXISTS  EQ 0 THEN GOTO :NOPARAMS;
-SET &where_stm = &where_stm | '; WHERE ( &parm2.EVAL &parmoper2.EVAL ' | &QT | &parmval2 | &QT | ' )';
-IF &parm3.EXISTS  EQ 0 THEN GOTO :NOPARAMS;
-SET &where_stm = &where_stm | '; WHERE ( &parm3.EVAL &parmoper3.EVAL ' | &QT | &parmval3 | &QT | ' )';
-IF &parm4.EXISTS  EQ 0 THEN GOTO :NOPARAMS;
-SET &where_stm = &where_stm | '; WHERE ( &parm4.EVAL &parmoper4.EVAL ' | &QT | &parmval4 | &QT | ' )';
-IF &parm5.EXISTS  EQ 0 THEN GOTO :NOPARAMS;
-SET &where_stm = &where_stm | '; WHERE ( &parm5.EVAL &parmoper5.EVAL ' | &QT | &parmval5 | &QT | ' )';
-TYPE &where_stm
-:NOPARAMS


I'm sure there is a more elegant way to do this code, but I need to get the detail data to the users today or tomorrow on a bunch of graphs, so this will work the the time being... and later I can tweak the coding.

Thanks again!

rob


WebFOCUS 8.0.0.5 - SQL Server - Windows Server