Focal Point
[CLOSED]Column Alias

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

May 12, 2016, 12:32 PM
Matt B
[CLOSED]Column Alias
If I have a simple report with a define field to get the YEAR from a date variable. How can I use the Year in the column alias?

i.e. I want the column to say "CLAIMS INCURRED 2016" and it will update as the dates change instead of hardcoding the year.

Does that make sense?

Thanks Matt



DEFINE FILE HLDRPT1
IN_YEAR/YY = '&&DT_BOY';
END



TABLE FILE HLDRPT1

HEADING
"World Kitchen LLC"
"Total "Line of Coverage: WC"
"Report Run on &DATE"

SUM
IN_1MO_PRIOR_CNT AS 'CLAIMS INCURRED, %%INSERT DEFINE FIELD HERE%%'



BY CORP_LEVEL2 AS 'LEVEL 2' SUB-TOTAL
BY CORP_LEVEL3 AS 'LEVEL 3'

This message has been edited. Last edited by: <Emily McAllister>,
May 12, 2016, 12:56 PM
Ricardo Augusto
Easy.

SUM
IN_1MO_PRIOR_CNT	AS 'CLAIMS INCURRED &&DT_BOY'
  


OR

 
SUM
IN_1MO_PRIOR_CNT	AS 'CLAIMS INCURRED <IN_YEAR'

 



WebFOCUS 8.1.05 / APP Studio
May 12, 2016, 01:06 PM
GavinL
Don't think you can do it as a define. Make it a variable, it should work.

-DEFAULTH &MYFIELD = '2014';

TABLE FILE CAR
SUM
     CAR.BODY.SALES
BY  CAR.ORIGIN.COUNTRY AS 'This is &MYFIELD' 
BY  CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
END




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
May 12, 2016, 01:08 PM
GavinL
[QUOTE]SUM
IN_1MO_PRIOR_CNT	AS 'CLAIMS INCURRED <IN_YEAR'[/QUOTE]


Doesn't work.. WebFOCUS thinks your trying to put HTML in your title and it removes it. Or at least in 8.1.04 it does.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
May 12, 2016, 01:28 PM
Squatch
If I understand you correctly, you want this:

DEFINE FILE HLDRPT1
IN_YEAR/YY TITLE 'CLAIMS INCURRED 2016' = '&&DT_BOY';
END

Update: Sorry, that's still hardcoding.

Try this:

DEFINE FILE HLDRPT1
IN_YEAR/YY TITLE 'CLAIMS INCURRED &&DT_BOY' = '&&DT_BOY';
END



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
May 12, 2016, 01:34 PM
GavinL
I think he's trying to convert it to YY at the same time.. I hate date conversions and I have the damn book on it. When a language has a book on just date conversions, it should be a wake up call, that just maybe that needs to be simplified.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
May 12, 2016, 01:38 PM
Squatch
quote:
Originally posted by GavinL:
I think he's trying to convert it to YY at the same time.. I hate date conversions and I have the damn book on it. When a language has a book on just date conversions, it should be a wake up call, that just maybe that needs to be simplified.

Hallelujah! So I'm not alone after all. I have that date book too, and I was using it today (Or trying to, anyway). WebFOCUS date handling is perpetually confusing!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
May 12, 2016, 02:00 PM
Ricardo Augusto
I will buy mine asap.

I got the WebFOCUS Worksheet already.
Dollar is expensive for brazilians, U$1 is around R$3.6

;(

BTW, our President was replaced today. I hope the economy become better!


WebFOCUS 8.1.05 / APP Studio
May 12, 2016, 02:47 PM
Squatch
After stealing from GavinL, I came up with this:

-SET &DT_BOY = &DATEYY;

TABLE FILE CAR
SUM
     CAR.BODY.SALES
BY  CAR.ORIGIN.COUNTRY AS 'This is &DT_BOY' 
BY  CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
END
-RUN



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
May 13, 2016, 11:43 AM
Matt B
The problem is I want the month name? The fact that I am even asking this is crazy. I have used 4 differnt BI tools and this is certainly the most difficult to accomplis the simpliest tasks.

I need something like...

-SET &MONTH_NAME = ????


TABLE FILE CAR
SUM
CAR.BODY_SALES AS '&MONTH_NAME'
END
-RUN
May 13, 2016, 01:02 PM
John W Price
This thread raises several Date related questions. I will try to assist in as many as I can.

DATE COMPLICATION: Because WebFOCUS connects to virtually all database systems, they support many different date formats. These include Alphanumeric dates, Integer dates (Packed and Floating point and Double precision as well). As a general rule the above formats will respect the year component when sorting ONLY when the year is first in the format.
As advanced date components, WebFOCUS supports SmartDate (aka Date) and DateTime formats. These are stored internally as some form of elapsed days with a decimal value for the Time component. As a result they are sorted correctly no matter where the year component is displayed.
FUNCTION USE: There are different functions for each date format. You must use the correct function for the format used (note in 8.1.05 several function are introduced the work with both SmartDate and DateTime formats).
EMBEDDING FIELD values: Column titles can not display embedded fields. You can accomplish this if the date is a sort value and then embedding the field in a SUBHEAD or SUBFOOT.
DIALOGUE MANAGER: DM variable are resolves at the time the focexec is compiled. They do not change with sort breaks.
Good luck to all.



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com