BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Sunset Ride 
Sunset Ride 

General Notice: BOB is going to retire...please see details here. All BOB forums have been converted to "read only" as of September 1st.
General Notice: No events within the next 45 days.

[BOBJ 4.x] Elseif not being overriden by previous if


 
Search this topic... | Search Desktop Intelligence... | Search Box
Register or Login to Post    Forum Index -> Building Reports -> Desktop Intelligence  Previous TopicPrint TopicNext Topic
Author Message
rpinxt
Senior Member
Senior Member



Joined: 23 Jan 2019

Posts: 92



PostPosted: Thu Jan 30, 2020 8:00 am 
Post subject: Elseif not being overriden by previous if

Cryptic subject but hoping my example will help.

I have this formula:
Code:
=If Not(IsNull([test])) Then "Rep.Period"
ElseIf(IsNull([test])) Then If([vRevYear]=[vReportingYear]-1 And [vRevMonth]=12) Then "Rep.Period"
ElseIf ([vRevYear]=[vReportingYear]-1 And [vRevMonth]=[vReportingMonth]) Then "LY Period"
Else "Other"


I have a list with accounts with month and period.
Now I have selected year 2020 month 01 and I want to compare it with 2019 01.

However not every account has an amount in 2020 01.
In that case I want 2019 12 to be the "Re.Period"

In case if there is no 2020 01 it works well.
However in case there is 2020 01 it gives 2020 01 as "Rep.Period" AND 2019 12 aswell.

Looking at the code I can see why it could go wrong but how do I solve it??

ps: the variable test is a sum on YTD amount of 2020 01.
So if it does not find it it will return Null
Back to top
Mark P
Forum Devotee
Forum Devotee



Joined: 03 Feb 2003
ASUG Icon
Posts: 11524
Location: Manchester, UK


flag
PostPosted: Thu Jan 30, 2020 11:55 am 
Post subject: Re: Elseif not being overriden by previous if

This looks like Webi code. Have you posted in Desktop Intelligence forum by mistake?
_________________
Current version I'm using: 4.1 SP3 over Oracle. Well versed in SQL Server too, including SSIS

______________________________________
Prior versions used: BO3,4,5,6.5,XIr2,XI3, 4.1 - yes, I have been using BO since 1996!
Back to top
rpinxt
Senior Member
Senior Member



Joined: 23 Jan 2019

Posts: 92



PostPosted: Fri Jan 31, 2020 2:33 am 
Post subject: Re: Elseif not being overriden by previous if

Ahh...yes it is webi.

Looks indeed like I made a mistake.

Can it be moved or should I just post same in correct forum? (that would be?)

**EDIT**

Nevermind I solved it.
Back to top
Mark P
Forum Devotee
Forum Devotee



Joined: 03 Feb 2003
ASUG Icon
Posts: 11524
Location: Manchester, UK


flag
PostPosted: Fri Jan 31, 2020 8:59 am 
Post subject: Re: Elseif not being overriden by previous if

rpinxt wrote:
Ahh...yes it is webi.

Looks indeed like I made a mistake.

Can it be moved or should I just post same in correct forum? (that would be?)

**EDIT**

Nevermind I solved it.


You solved the problem or how to get it moved?

_________________
Current version I'm using: 4.1 SP3 over Oracle. Well versed in SQL Server too, including SSIS

______________________________________
Prior versions used: BO3,4,5,6.5,XIr2,XI3, 4.1 - yes, I have been using BO since 1996!
Back to top
rpinxt
Senior Member
Senior Member



Joined: 23 Jan 2019

Posts: 92



PostPosted: Fri Jan 31, 2020 9:01 am 
Post subject: Re: Elseif not being overriden by previous if

The entire problem icon_wink.gif

Took a different approach and that worked out better.
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Building Reports -> Desktop Intelligence  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0286 seconds using 17 queries. (SQL 0.0028 Parse 0.0009 Other 0.0249)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo