Focal Point
[CLOSED] Define; last quarter

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

September 10, 2015, 04:34 PM
Nicholas Spyrison
[CLOSED] Define; last quarter
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
September 11, 2015, 04:49 AM
Martin vK
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 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
September 11, 2015, 06:26 AM
Danny-SRL
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

September 11, 2015, 01:18 PM
Nicholas Spyrison
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