Focal Point
Comparision of records

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

June 19, 2007, 01:22 PM
<NAG>
Comparision of records
Hi,
I have a list of items which have prices for the last three months. Now i need to compare the prices for each iten between these three months and i need to find if the price has Increased or Decreased or Nochnage of that item.
Is there any way to achive this.
Thanks
Nag
June 19, 2007, 01:41 PM
mgrackin
NAG,

Try the following:

TABLE FILE CAR
PRINT SALES
COMPUTE UPDWN/A3=IF (SALES GT LAST SALES) THEN 'UP' ELSE 'DWN';
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
June 19, 2007, 01:42 PM
atc12345
Can you describe what your MFD looks like?
June 19, 2007, 01:43 PM
Francis Mariani
Another quick and d!rty example:

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
-RUN

TABLE FILE GGORDER
SUM QUANTITY AS 'ORDER'
BY PRODUCT_CODE
ACROSS ORDER_DATE
WHERE ORDER_DATE GE '10/01/97'
WHERE ORDER_DATE LE '12/01/97'
ON TABLE HOLD AS HORDER
END
-RUN

TABLE FILE HORDER
PRINT 
E02
E03
COMPUTE DIFF1/D6 = E03 - E02;
E04
COMPUTE DIFF1/D6 = E04 - E03;
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 19, 2007, 02:30 PM
<NAG>
Hi
here is the example of my data

Item Month Price
A1 1 10
A1 2 7.5
A1 3 5
A2 1 5
A2 2 6
A2 3 10
A3 1 10
A3 2 10
A3 3 10
. . .
. . .
. . .
. . .
. . .
F3 3 10

Here my ItemImproving is: A2
ItemDecresing is: A1
ItemNochange is: A3

Thanks
Nag
June 19, 2007, 03:24 PM
Francis Mariani
Nag, take a look at my example - it should work for you.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 20, 2007, 11:07 AM
atc12345
Nag: If A1 in month 3 was 11 what would you do?
June 20, 2007, 12:32 PM
<NAG>
Hi act 12345

That record will be ignored
June 20, 2007, 12:59 PM
Alan B
quote:
Item Month Price
A1 1 10
A1 2 7.5
A1 3 5
A2 1 5
A2 2 6
A2 3 10
A3 1 10
A3 2 10
A3 3 10
. . .
. . .
. . .
. . .
. . .
F3 3 10

Here my ItemImproving is: A2
ItemDecresing is: A1
ItemNochange is: A3

quote:

Nag: If A1 in month 3 was 11 what would you do?

quote:

Hi act 12345
That record will be ignored


So from what you say, then
Item Month Price
A1 1 10
A1 2 7.5
A1 3 11
A2 1 5
A2 2 6
A2 3 10
A3 1 10
A3 2 10
A3 3 10
. . .
. . .
. . .
. . .
. . .
F3 3 10

ItemImproving is: A2
ItemNochange is: A3
ItemIgnore: A1


That I don't understand.


Alan.
WF 7.705/8.007