Focal Point
Report on Output for each comma delimited parameter.

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

April 24, 2007, 01:41 PM
SauPa
Report on Output for each comma delimited parameter.
Hi,

Requirement :-
Users provide a comma delimited list of policies [&POLICIES]( some valid - return a result
Others - do not return a result)
I have a procedure, that uses the &POLICIES and returns a report. - &POLICIES contains a comma separated list of policy numbers.
E.g. POLICIES =123,456,897
Assume that policy no.s 123, 456 return a row ( I have SQL that does that)
But Policy 897 does not.
The users would like the output result to retunr
Policy No Status ColD11 ColDtl2 ....
123 Valid 10 1000
456 Valid 20 987
897 NotFound - -

How would I go about doing something like this ?
Thanks,
Saurabh


Saurabh Palkar
April 24, 2007, 05:04 PM
GGSD
Can you change your SQL to return 'NotFound' if the row does not exist?


WebFOCUS 760 HPUX - Using MRE, Report Caster, Dashboard and Self Service.
April 24, 2007, 05:45 PM
SauPa
I am sure, how I would do this.
Just to understand, let us say my query is
Select policy, details
from policytable
where policy in (123,456,897)
-
Now Query shall return details for policies 123,456.
However I want to track the status for all 3 i.e I want to include a row for 897 and indicate that notfound.
Can I do this ?


Saurabh Palkar
April 25, 2007, 10:22 AM
GGSD
Saurabh,
I am not a SQL guru so I cannot tell you how to do it in SQL (although I think it is possible). But, it can be done in FOCUS using -READs and -WRITEs within a loop.
It is difficult to explain here, but if you look up -READ NOCLOSE and -WRITE commands, you will get the idea.
Basically, the plan is to begin a loop, read the comma delimited file, and pass the policy number to a &variable. Then do a table request against your policytable and if the &variable equals the policynumber in the table hold the results. If &RECORDS is 0 and no value is returned, then -WRITE to the HOLD file and append the &variable + 'Not Found'. Go to top of loop and -READ until there are no more &variables.
You will have to filedef the HOLD file as appendable.
I have done things like this before. It takes some effort, but it works.


WebFOCUS 760 HPUX - Using MRE, Report Caster, Dashboard and Self Service.
April 25, 2007, 12:04 PM
SauPa
Thanks for you help.
here is what I have done and it works.
Step1:
I created a Temporary table to store a list of all the policies that were input by the user.
Step2: I ran the report and queried the temporary table to track, which policies returned a report and which did not.
Step3: Based on step2, I now had information to update the status..

Thanks again for taking the time to discuss the issue.
Saurabh


Saurabh Palkar