Focal Point
[CLOSED] Search or Sorting data from different columns.

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

March 17, 2011, 09:11 AM
OITTester
[CLOSED] Search or Sorting data from different columns.
I have a question for a report which I cannot figure out. I have a table with columns (Title, vm1, vm2, vm3) holding account numbers. A company can have one or more accounts and account numbers can be listed in one or all the 3 columns. How can I display the fields where an account has been listed?

Example
Title vm1 vm2 vm3
MD 10 15 25
BOA 25 20 .
Citi . 33 10

If I select account 10, I need a return of all complany titles and columns where that account has been listed.
Which should be MD and Citi.

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


WebFOCUS 7.6
HP AIX (SERVER) & XP (Local)
all output
March 17, 2011, 09:35 AM
<FreSte>
With "If I select account 10 ...", do you mean you have a drilldown on that column??

If yes, in the fex that's is executed by the drilldown, you could do something like:
(let's say &ACNUM = 10)

....
WHERE vm1 EQ &ACNUM OR vm2 EQ &ACNUM OR vm3 EQ &ACNUM ;
....
March 17, 2011, 10:21 AM
OITTester
Yes, I have a dynamic list dilldown on vm1 (column),
T2 = tablename, vm1 = column name, ACNUM = Data or account #( since it is a dynamic list, the ACNUM will be selected from the dropdown list pointing to column - vm1
e.g
WHERE (T2.T2.vm1 EQ &vm1.(OR(FIND vm1, T2. T2. vm1 IN T2)). vm1. )
WHERE vm1 EQ &ACNUM OR vm2 EQ &ACNUM OR vm3 EQ &ACNUM ;

I have tried what you wrote but it gives me only records from vm1


WebFOCUS 7.6
HP AIX (SERVER) & XP (Local)
all output
March 17, 2011, 04:11 PM
<FreSte>
And what happens if you comment-out the first WHERE statement ??
April 01, 2011, 11:20 AM
OITTester
I have been out of the office, but I would like to update this request, I used FreSte code and it works great. Thanks FreSte


WebFOCUS 7.6
HP AIX (SERVER) & XP (Local)
all output