If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

wats wrong here??

Started by robin2008, 19 Nov 2008 12:57:12 PM

Previous topic - Next topic

robin2008

IF ( [A_B_C].[transactions].[IDSTRANSACTIONCODE]=101 AND [A_B_C].[transactions].[DTMEFFECTIVEDATE]=?promptBeginDate?
AND [A_B_C].[Date Of First Interest Rate Change].[DTMDATEOFFIRSTINTERESTCHANGE]< [A_B_C].[transactions].[Effective Index Date])

THEN

( CASE
   WHEN ([Remainder]<1250) THEN
     If(abs(1250 - [Remainder])> abs([Remainder]))
          Then
       (float(([WholeNumber])/1000000.0))   
     Else 
     (float(([WholeNumber]+1250)/1000000.0))

WHEN ([Remainder]<2500) THEN
     If(abs(2500 - [Remainder])>= abs([Remainder]-1250))
          Then
       (float(([WholeNumber]+1250)/1000000.0))   
     Else 
     (float(([WholeNumber]+2500)/1000000.0))

WHEN ([Remainder]<3750) THEN
     If(abs(3750 - [Remainder])>= abs([Remainder]-2500))
          Then
       (float(([WholeNumber]+2500)/1000000.0))   
     Else 
     (float(([WholeNumber]+3750)/1000000.0))

WHEN ([Remainder]<5000) THEN
     If(abs(5000 - [Remainder])>= abs([Remainder]-3750))
          Then
       (float(([WholeNumber]+3750)/1000000.0))   
     Else 
     (float(([WholeNumber]+5000)/1000000.0))

WHEN ([Remainder]<6250) THEN
     If(abs(6250 - [Remainder])>= abs([Remainder]-5000))
          Then
       (float(([WholeNumber]+5000)/1000000.0))   
     Else 
     (float(([WholeNumber]+6250)/1000000.0))

WHEN ([Remainder]<7500) THEN
     If(abs(7500 - [Remainder])>= abs([Remainder]-6250))
          Then
       (float(([WholeNumber]+6250)/1000000.0))   
     Else 
     (float(([WholeNumber]+7500)/1000000.0))

WHEN ([Remainder]<8750) THEN
     If(abs(8750 - [Remainder])>= abs([Remainder]-7500))
          Then
       (float(([WholeNumber]+7500)/1000000.0))   
     Else 
     (float(([WholeNumber]+8750)/1000000.0))

WHEN ([Remainder]<10000) THEN
     If(abs(10000 - [Remainder])>= abs([Remainder]-8750))
          Then
       (float(([WholeNumber]+8750)/1000000.0))   
     Else 
     (float(([WholeNumber]+10000)/1000000.0))

  END)

ELSE
    ([A_B_C].[transactions].[INTCURRENTINTRATE])




   

robin2008

??????
?????
?????
????
????

thank  you
robin

Suraj

#2

What issue are you having?
What error message do you get?

robin2008

I am not asking U by the way...........this is very easy......so not suitable for you...

by the way i got the solution..........




robin

Suraj

That's great.

I was just pointing that when posting, also post any error messages you got.
That way it'll be easier to solve the issue.

robin2008

thanks  for yr suggestion

keep some...with U....which help U at class............


thakx
robin

robin2008

i willtry to post error meesage from next time......

we were try to get round figure amount for some unique loan number
but it works now......


thankyou
robin

robin2008

hello friends...

i have tried above logic ,,,,and was working OK...

but now it giving me hard time......says parsing error........plz give me some hints....
error--

QE-DEF-0260

QE-DEF-0261 QFWP - Parsing text: IF([Reverse_Mortgage].[transactions].[IDSTRANSACTIONCODE]=101 AND [Reverse_Mortgage].[transactions].[DTMEFFECTIVEDATE]= ?promptBeginDate? AND [Reverse_Mortgage].[Date Of First Interest Rate Change].[DTMDATEOFFIRSTINTERESTCHANGE]<[Reverse_Mortgage].[transactions].[Effective Index Date]) THEN (case when([Remainder]<1250)then if(abs(1250- [Remainder])> abs([Remainder])) then (float(([WholeNumber])/1000000.0)) else (float(([WholeNumber]+1250)/1000000.0)) when([Remainder]<2500)then if(abs(2500- [Remainder])>= abs([Remainder]-1250)) then (float(([WholeNumber]+1250)/1000000.0)) else (float(([WholeNumber]+2500)/1000000.0)) when([Remainder]<3750)then if(abs(3750- [Remainder])>= abs([Remainder]-2500)) then (float(([WholeNumber]+2500)/1000000.0)) else (float(([WholeNumber]+3750)/1000000.0)) when([Remainder]<5000)then if(abs(5000- [Remainder])>= abs([Remainder]-3750)) then (float(([WholeNumber]+3750)/1000000.0)) else (float(([WholeNumber]+5000)/1000000.0)) when([Remainder]<6250)then if(abs(6250- [Remainder])>= abs([Remainder]-5000)) then (float(([WholeNumber]+5000)/1000000.0)) else (float(([WholeNumber]+6250)/1000000.0)) when([Remainder]<7500)then if(abs(7500- [Remainder])>= abs([Remainder]-5000)) then (float(([WholeNumber]+6250)/1000000.0)) else (float(([WholeNumber]+7500)/1000000.0)) when([Remainder]<8750)then if(abs(8750- [Remainder])>= abs([Remainder]-7500)) then (float(([WholeNumber]+7500)/1000000.0)) else (float(([WholeNumber]+8750)/1000000.0)) when([Remainder]<10000)then if(abs(10000- [Remainder])>= abs([Remainder]-8750)) then (float(([WholeNumber]+8750)/1000000.0)) else (float(([WholeNumber]+10000)/1000000.0)) end) else ([Reverse_Mortgage].[transactions].[INTCURRENTINTRATE]) QE-DEF-0260 Parsing error before or near position: 345 of: "IF([Reverse_Mortgage].[transactions].[IDSTRANSACTIONCODE]=101 AND [Reverse_Mortgage].[transactions].[DTMEFFECTIVEDATE]= ?promptBeginDate? AND [Reverse_Mortgage].[Date Of First Interest Rate Change].[DTMDATEOFFIRSTINTERESTCHANGE]<[Reverse_Mortgage].[transactions].[Effective Index Date]) THEN (case when([Remainder]<1250)then if(abs(1250-" QE-DEF-0261 QFWP - Parsing text: IF([Reverse_Mortgage].[transactions].[IDSTRANSACTIONCODE]=101 AND [Reverse_Mortgage].[transactions].[DTMEFFECTIVEDATE]= ?promptBeginDate? AND [Reverse_Mortgage].[Date Of First Interest Rate Change].[DTMDATEOFFIRSTINTERESTCHANGE]<[Reverse_Mortgage].[transactions].[Effective Index Date]) THEN (case when([Remainder]<1250)then if(abs(1250- [Remainder])> abs([Remainder])) then (float(([WholeNumber])/1000000.0)) else (float(([WholeNumber]+1250)/1000000.0)) when([Remainder]<2500)then if(abs(2500- [Remainder])>= abs([Remainder]-1250)) then (float(([WholeNumber]+1250)/1000000.0)) else (float(([WholeNumber]+2500)/1000000.0)) when([Remainder]<3750)then if(abs(3750- [Remainder])>= abs([Remainder]-2500)) then (float(([WholeNumber]+2500)/1000000.0)) else (float(([WholeNumber]+3750)/1000000.0)) when([Remainder]<5000)then if(abs(5000- [Remainder])>= abs([Remainder]-3750)) then (float(([WholeNumber]+3750)/1000000.0)) else (float(([WholeNumber]+5000)/1000000.0)) when([Remainder]<6250)then if(abs(6250- [Remainder])>= abs([Remainder]-5000)) then (float(([WholeNumber]+5000)/1000000.0)) else (float(([WholeNumber]+6250)/1000000.0)) when([Remainder]<7500)then if(abs(7500- [Remainder])>= abs([Remainder]-5000)) then (float(([WholeNumber]+6250)/1000000.0)) else (float(([WholeNumber]+7500)/1000000.0)) when([Remainder]<8750)then if(abs(8750- [Remainder])>= abs([Remainder]-7500)) then (float(([WholeNumber]+7500)/1000000.0)) else (float(([WholeNumber]+8750)/1000000.0)) when([Remainder]<10000)then if(abs(10000- [Remainder])>= abs([Remainder]-8750)) then (float(([WholeNumber]+8750)/1000000.0)) else (float(([WholeNumber]+10000)/1000000.0)) end) else ([Reverse_Mortgage].[transactions].[INTCURRENTINTRATE])

robin2008

sorry

Actually yestersday was working fine.........and i have not chaged anything.......but when i tried to run 2day......it was giving me those issue

blom0344

Quote from: robin2008 on 20 Nov 2008 11:49:32 AM
sorry

Actually yestersday was working fine.........and i have not chaged anything.......but when i tried to run 2day......it was giving me those issue

To start with :

Only use CASE and do not mix CASE with IF constructs. It makes it a bit easier to parse the code

pooja

i did only case....but still not working

(case
   when([Remainder]<1250)then
   if(abs(1250- [Remainder])> abs([Remainder]))
   then
   (float(([WholeNumber])/1000000.0))
   else
   (float(([WholeNumber]+1250)/1000000.0))

   when([Remainder]<2500)then
   if(abs(2500- [Remainder])>= abs([Remainder]-1250))
   then
   (float(([WholeNumber]+1250)/1000000.0))
   else
   (float(([WholeNumber]+2500)/1000000.0))

   when([Remainder]<3750)then
   if(abs(3750- [Remainder])>= abs([Remainder]-2500))
   then
   (float(([WholeNumber]+2500)/1000000.0))
   else
   (float(([WholeNumber]+3750)/1000000.0))

   when([Remainder]<5000)then
   if(abs(5000- [Remainder])>= abs([Remainder]-3750))
   then
   (float(([WholeNumber]+3750)/1000000.0))
   else
   (float(([WholeNumber]+5000)/1000000.0))

   when([Remainder]<6250)then
   if(abs(6250- [Remainder])>= abs([Remainder]-5000))
   then
   (float(([WholeNumber]+5000)/1000000.0))
   else
   (float(([WholeNumber]+6250)/1000000.0))

   when([Remainder]<7500)then
   if(abs(7500- [Remainder])>= abs([Remainder]-5000))
   then
   (float(([WholeNumber]+6250)/1000000.0))
   else
   (float(([WholeNumber]+7500)/1000000.0))

   when([Remainder]<8750)then
   if(abs(8750- [Remainder])>= abs([Remainder]-7500))
   then
   (float(([WholeNumber]+7500)/1000000.0))
   else
   (float(([WholeNumber]+8750)/1000000.0))

   when([Remainder]<10000)then
   if(abs(10000- [Remainder])>= abs([Remainder]-8750))
   then
   (float(([WholeNumber]+8750)/1000000.0))
   else
   (float(([WholeNumber]+10000)/1000000.0))

end)

pooja

i think u have some issue with other query

Suraj

What blom meant was to use case only.
For example, you have
case
   when([Remainder]<1250)then
   if(abs(1250- [Remainder])> abs([Remainder]))
   then
   (float(([WholeNumber])/1000000.0))
   else
   (float(([WholeNumber]+1250)/1000000.0))
...

Instead use:
case
   when([Remainder]<1250)then
   case
        when (abs(1250- [Remainder])> abs([Remainder]))
        then  (float(([WholeNumber])/1000000.0))
        else   (float(([WholeNumber]+1250)/1000000.0))
    end

This way, you only have case construct and will be easier to resolve parsing issues as if-then-else statements need () while case don't.

robin2008

U mean
I have to continue same way for all the condition till 10000......????


thank you


robin

blom0344

For ... sake, write your conditional code by either solely CASE or - less ideal - IF THEN ELSE.
Do not mix those 2 approaches.
Using solely CASE makes it easier to resolve parsing issues as Suraj mentioned..