Let's Get Social!
Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to find a disimilar values based on a given column and show it on output
 Go New Search Notify Tools Reply
 [CLOSED] How to find a disimilar values based on a given column and show it on output
Member
 posted July 30, 2013 05:08 AM
Hi,
Lets take an example of CAR file :
TABLE FILE CAR
PRINT
SEATS
BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY EQ 'W GERMANY'
WHERE CAR EQ 'BMW'
END
-RUN
-EXIT

The output of the above will be :
COUNTRY CAR MODEL SEATS
W GERMANY BMW 2002 2 DOOR 5
2002 2 DOOR AUTO 4
3.0 SI 4 DOOR 5
3.0 SI 4 DOOR AUTO 5

Iam trying to get only the details where the Seats values are different(In this case i need to pull the Model : 2002 2 DOOR AUTO where the number of Seats are 4 which is uncommon among the rest of the values i.e.,5).
Can anyone tell me how to get this done as this is very urgent?Any help is greatly appreciated.Thanks a lot in advance!

This message has been edited. Last edited by: <Kathryn Henning>,

webfocus 769,windows 7,html

 Posts: 24 | Registered: July 16, 2010 IP
Platinum Member
 posted July 30, 2013 07:03 AM Hide Post
What makes a value uncommon? When it occurs only once, twice?

For the example you give the following would work, but this is because I specify that I only want rows with distinct values in the column SEATS.

TABLE FILE CAR
SUM
CNT.SEATS NOPRINT
BY SEATS NOPRINT
PRINT
SEATS
BY SEATS NOPRINT
BY MODEL
BY COUNTRY
BY CAR
WHERE COUNTRY EQ 'W GERMANY'
WHERE CAR EQ 'BMW'
WHERE TOTAL CNT.SEATS EQ 1
END

Without a better understanding of how you define uncommon I can't be more help.

WF 7.6.11
Output: HTML, PDF, Excel

 Posts: 123 | Location: UK | Registered: October 09, 2003 IP
Expert
 posted July 30, 2013 01:08 PM Hide Post
quote:
as this is very urgent
Isn't everything?

A better, more complete explanation, of your requirement would be very helpful.

From what I gather, from what you did say, I'd prompt for the dissimilar value (the value which I want do use in my dissimilar filtering) and use a NE in my table file request.

 Posts: 3084 | Location: Middle Tennessee | Registered: February 23, 2005 IP
Silver Member
 posted July 31, 2013 04:06 PM Hide Post
Try something like this:

TABLE FILE CAR
PRINT
SEATS
BY COUNTRY
BY CAR
RANKED BY SEATS
WHERE COUNTRY EQ 'W GERMANY'
WHERE CAR EQ 'BMW'
END
--

If you are using oracle, you can try RANK fucntion using Partition by clause to rank the elements based on the occurance.

Webfocus 7.1.6, Webfocus 7.7, Webfocus 8

 Posts: 33 | Registered: August 16, 2012 IP
Silver Member
 posted July 31, 2013 04:08 PM Hide Post
TABLE FILE CAR
PRINT
SEATS
BY COUNTRY
BY CAR
RANKED BY LOWEST 1 SEATS
WHERE COUNTRY EQ 'W GERMANY'
WHERE CAR EQ 'BMW'
END

Webfocus 7.1.6, Webfocus 7.7, Webfocus 8

 Posts: 33 | Registered: August 16, 2012 IP
Expert
 posted August 01, 2013 02:41 PM Hide Post
TABLE FILE ibisamp/CAR
SUM MAX.SEATS
BY COUNTRY BY CAR
PRINT SEATS
BY COUNTRY BY CAR BY MODEL
WHERE COUNTRY EQ 'W GERMANY'
WHERE CAR EQ 'BMW'
ON TABLE HOLD
END
TABLE FILE HOLD
PRINT * WHERE E03 EQ E05 (or NE , whatever you want)
END

 In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID

 Posts: 3811 | Location: Manhattan | Registered: October 28, 2003 IP