Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Define; last quarter
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Define; last quarter
 Login/Join
 
Gold member
posted
I am simply trying to find the last quarter.
Date_YYYYQQ is A6
Date_Calendar_Year is I4

I have the following define.

  DEFINE FILE DM
iYYYYQQ/I6=EDIT( Date_YYYYQQ );
aQQ/A2=EDIT( Date_YYYYQQ, '$$$$99');
LastYYYYQQ/I6=IF aQQ EQ '01' THEN ( Date_Calendar_Year -1)|04 ELSE iYYYYQQ-1;
END  


results in:
  0 ERROR AT OR NEAR LINE      4  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC279) NUMERIC ARGUMENTS IN PLACE WHERE ALPHA ARE CALLED FOR 


I know aQQ EQ '01'. what is the issue.

As a side issue;
When I try iQQ/I2=EDIT( Date_YYYYQQ, '$$$$99');
I get:
  (FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: iQQ 

Why does editing the alpha to Int work without the mask, but breaks when Include the mask?


Thanks all-

This message has been edited. Last edited by: Nicholas Spyrison,


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi Nicholas,

The problem is with
( Date_Calendar_Year -1)|04
. You can not use string concatenation with numbers.
Try following:
100 * (Date_Calendar_Year -1) + 4


Martin.


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 154 | Registered: March 29, 2013Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You could try:
  
DEFINE FILE CAR
QR/I2=IF LAST QR EQ 4 THEN 1 ELSE LAST QR + 1;
Date_YYYYQQ/A6 WITH COUNTRY='2015' | EDIT(QR) ;
QQ/I2=EDIT(EDIT(Date_YYYYQQ,'$$$$99'));
AQQ/I2=(QQ - 1) * 3 + 3;
AYYYYQQ/A8YYMD=EDIT(Date_YYYYQQ,'9999') | EDIT(AQQ) | '01' ;
FYYYYQQ/YYQ=AYYYYQQ;
LastYYYYQQ/YYQ=FYYYYQQ - 1;
END
TABLE FILE CAR
PRINT 
 COUNTRY LastYYYYQQ
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1936 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks Martin!

Got it working after running into a multiple hierarchy issue.

One more quick question:

given:
 Date_YYYYQQ/A6 WITH COUNTRY='2015' | EDIT(QR) ; 


Could someone explain what "WITH COUNTRY" is doing? is it tying Date_YYYYQQ to the COUNTRY Grain level?


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Define; last quarter

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.