[SOLVED] I got an error through Report painter doing a DECODE
Hi,
Doing my first baby steps in Webfocus I got this error:
-IF PROFITCENT NE LAST PROFITCENT THEN ABC = 0 ERROR AT OR NEAR LINE 112 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING
Please see the partial following code of my report:
Your help will be appreciated. ThanksThis message has been edited. Last edited by: Kerry,
Marikaki
WF 7.7.03m, MRE, BI Dashboard, DevStudio, Report Caster, Windows 7, I.E. 8/9, Apache Tomcat 6.0, Derby Output formats: Excel2K, PDF, HTML, AHTML
January 26, 2010, 12:10 PM
njsden
Hi Marikaki,
You seem to be mixing FOCUS code (use of LAST keyword pertaining to record manipulation) with Dialog Manager-specific syntax which are not really mixable the way you're trying to do.
Could you describe exactly what you're attempting to do to see if any of us can shed some light?
I would suggest however that you take a deep review on product documentation to strengthen your foundations on the tool (Creating Reports with WebFOCUS Language comes to my mind).
Please post a little more code. to give every one a better understnading
Scott
January 26, 2010, 12:48 PM
GinnyJakes
To further explain, anything that starts with a dash is considered Dialogue Manager and you should be testing against amper variables, not real fields and njsden is correct in that LAST won't work there.
If your IF test is in a DEFINE or COMPUTE, then it must be on the right-hand side of an equal sign, i.e.
Originally posted by TexasStingray: Please post a little more code. to give every one a better understnading
I would like my report to print a short description instead of the long one of the profit center column on each breakdown . ------------------------------------------ -DEFAULTS &APCDESC = 'ABC'; ....
TABLE FILE T3Y_SLSWKBGT -IF PROFITCENT NE LAST PROFITCENT THEN &APCDESC = DECODE PROFITCENT ( 001 'MTL' 401 'QUE' 150 'BOO' 200 'DES' 300 'ALM' 500 'HUO' 100 'BAR' 600 'MUE') ELSE FOC_NONE; SUM CURSALES/P12C AS 'RÉEL(R),ACTUEL' COMPUTE CPSLSCUM/D12 = IF PRFCENTDSC EQ LAST PRFCENTDSC THEN CPSLSCUM + CURSALES ELSE CURSALES; AS '***.'
..... -*BY PRFCENTDSC AS 'Centre,Profit' BY &APCDESC AS 'Ctr,Pft' BY PERIODWK AS 'Sem.' BY NBRWDYWK AS '#Jrs' HEADING "&TITLE_1" ....
I can provide more, just tell me.
Marikaki
WF 7.7.03m, MRE, BI Dashboard, DevStudio, Report Caster, Windows 7, I.E. 8/9, Apache Tomcat 6.0, Derby Output formats: Excel2K, PDF, HTML, AHTML
January 26, 2010, 12:57 PM
GinnyJakes
Is 'ABC' a column name in T3Y_SLSWKBGT? I'm asking this because you have a BY phrase which will evaluate to 'BY ABC AS ...".
Is PROFITCENT a column name as well?
If I could take a guess, I'd say that it needs to look like this:
DEFINE FILE T3Y_SLSWKBGT
APCDESC/A3=DECODE PROFITCENT ( 001 'MTL' 401 'QUE' 150 'BOO' 200 'DES' 300 'ALM' 500 'HUO' 100 'BAR' 600 'MUE') ELSE ' ';
END
TABLE FILE T3Y_SLSWKBGT
SUM
CURSALES/P12C AS 'RÉEL(R),ACTUEL'
COMPUTE CPSLSCUM/D12 = IF PRFCENTDSC EQ LAST PRFCENTDSC THEN CPSLSCUM + CURSALES ELSE CURSALES; AS '***.'
.....
-*BY PRFCENTDSC AS 'Centre,Profit'
BY APCDESC AS 'Ctr,Pft'
BY PERIODWK AS 'Sem.'
BY NBRWDYWK AS '#Jrs'
HEADING
"&TITLE_1"
....
You got it right Ginny. Thanks alot. It works. That will enthusiamed me to continue using forums. This can be considered as closed.
quote:
Originally posted by GinnyJakes: Is 'ABC' a column name in T3Y_SLSWKBGT? I'm asking this because you have a BY phrase which will evaluate to 'BY ABC AS ...".
Is PROFITCENT a column name as well?
If I could take a guess, I'd say that it needs to look like this:
DEFINE FILE T3Y_SLSWKBGT
APCDESC/A3=DECODE PROFITCENT ( 001 'MTL' 401 'QUE' 150 'BOO' 200 'DES' 300 'ALM' 500 'HUO' 100 'BAR' 600 'MUE') ELSE ' ';
END
TABLE FILE T3Y_SLSWKBGT
SUM
CURSALES/P12C AS 'RÉEL(R),ACTUEL'
COMPUTE CPSLSCUM/D12 = IF PRFCENTDSC EQ LAST PRFCENTDSC THEN CPSLSCUM + CURSALES ELSE CURSALES; AS '***.'
.....
-*BY PRFCENTDSC AS 'Centre,Profit'
BY APCDESC AS 'Ctr,Pft'
BY PERIODWK AS 'Sem.'
BY NBRWDYWK AS '#Jrs'
HEADING
"&TITLE_1"
....
How does that look to you? Does it make sense?
Marikaki
WF 7.7.03m, MRE, BI Dashboard, DevStudio, Report Caster, Windows 7, I.E. 8/9, Apache Tomcat 6.0, Derby Output formats: Excel2K, PDF, HTML, AHTML