Focal Point
Setting objectives based on the info of previous months

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

May 09, 2012, 09:58 AM
DavidGarcia
Setting objectives based on the info of previous months
Posted May 09, 2012 09:19 AM
Hello

I want to make a report in which I can compare the information of 2 different columns (both columns belong to the same field).

Example

01/12 02/12 "COMPARISON COLUMN"
#Datefield1##Datefield1#

10 12 12/10
11 14 14/11
12 16 16/12
. . ./.
. . ./.
n n n/n

I have 2 issues

1.- I am using the report assistant cause I am not a developer so essentially I need to fix this with R.A.
2.- 01/12 and 02/12 come from a single date field converted to an MY format.

I´ve tried several things but none of them worked.

Is there a way to do this???

Regards


Webfocus 7.7.03
May 10, 2012, 09:06 AM
Anatess
Hi David,

I guess this is the same question from the PMF sub-forum. I replied to that one. I'll just go ahead and reply to this one too.

Your question is not very clear. Let me see if I understand it:
1.) You have 2 tables - one for the current month, the other for the previous month.
2.) Both tables have a field called DATEFIELD1.
3.) You want the DATEFIELD1 from the current month table and the DATEFIELD1 from the previous month table to appear on the same line in the report.

If that's the case, then use JOIN to combine the 2 tables and report on the resulting table.

Or, if the case is that you have one table and you have the current month as one record, then the previous month as another record in that table, you can sort the table on the DATEFIELD1 field, then use LAST function to refer to the previous month. Here's an example using the CAR file:

DEFINE FILE CAR
PRVCAR/A20=LAST CAR;
END
TABLE FILE CAR
PRINT CAR PRVCAR
ON TABLE PCHOLD FORMAT HTML
END

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


WF 8.1.05 Windows
May 11, 2012, 10:02 AM
DavidGarcia
Hello

I think I didn´t explain correctly. I just have 1 table (DATEFIELD1/HYYMDS). From this table I used the HDATE(DATEFIELD1/MY) to get my information displayed on a monthly basis. So I could see :

JANUARY FEBRUARY MARCH ....

1 2 3 ...

What I want to do is to create new columns next to JANUARY, FEBRUARY, MARCH ....... So that the column to the right of Febraury contains the number "1" that originally belongs to JANUARY. I want to make this because the values represent monthly sales and I want to set current month sales objectives based on previous months information. I tried to use the LAST function but it didn´t seem to work out for me. Maybe it is because I did´n apply the function to the right field (the fields I tried were DATEFIELD1 and SALES).

Hope this is more understandable.

Regards


Webfocus 7.7.03
May 11, 2012, 12:57 PM
Anatess
Sorry David, it's still not quite clear.

If you have 1 table with 2 fields with a master file description like this:
FILENAME=MYDATA, SUFFIX=FOC, $
  SEGMENT=MYDATA, SEGTYPE=0$
    FIELDNAME=DATEFIELD1, USAGE=HYYMDs, $
    FIELDNAME=SALES, USAGE=D12.2, $


And you report on that like this:
TABLE FILE MYDATA
PRINT SALES
BY DATEFIELD1
END


You'll get this report:

DATEFIELD1 SALES
----------------
JANUARY    1
FEBRUARY   2
MARCH      3

etc...


If you say:

TABLE FILE MYDATA
PRINT LAST SALES
BY DATEFIELD1
END


You'll get:

DATEFIELD1 SALES
----------------
JANUARY    0
FEBRUARY   1
MARCH      2

etc...


Now, the sample report you showed that looks like this:

JANUARY FEBRUARY MARCH
----------------------
1       2        3



Is something that would come out of an ACROSS statement. Is that the case? Then the same LAST function would work for it too if you say it like this:

TABLE FILE MYDATA
PRINT LAST SALES
BY DATEFIELD1 NOPRINT
ACROSS DATEFIELD1
END



You know, it might be easier if you just paste your master file and your code right here so we can understand what you're trying to accomplish.


WF 8.1.05 Windows
May 11, 2012, 01:22 PM
DavidGarcia
Hello Anatess

I cannot show you my code because I am not using dev studio (I am not a developer), I use the Report Assistant.

My report uses an across to display sales in columns. I can´t attach the excel file here so I don´t know how to explain what I want better. The report assistant has also limitations so I have to work under these conditions.


Webfocus 7.7.03