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

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: BOB is going to retire...please see details here.
General Notice: No events within the next 45 days.

Case statement for Condition object


 
Search this topic... | Search Semantic Layer / Universe Designer... | Search Box
Register or Login to Post    Forum Index -> Semantic Layer / Universe Designer  Previous TopicPrint TopicNext Topic
Author Message
americanmc
Principal Member
Principal Member



Joined: 30 Dec 2009

Posts: 341


flag
PostPosted: Thu Mar 21, 2013 12:20 am 
Post subject: Case statement for Condition object

Hi All,
I have an issue and keep getting error parsing my filter , condition object. I am using efashion as example to explain my issue.

I have state, City, Lines and Revenue in my Report.
I have a section on City.
Say I want to say" If the City is Los Angeles, then show only Lines "City Skirts , City Trousers", If the City is Austin then show only Lines "Jackets".
Need a Case statment of some sort to resolve this.
I am getting an error of missing operator ...
Need help with the syntax to resolve this boolean ... Thanks
cuss.gif

_________________
Did you think that man was created for nothing and that one day he would not have to return to his Lord?
Back to top
Andreas
Forum Advocate
Forum Advocate



Joined: 20 Jun 2002

medal_silver.gif*2medal_gold.gif
Posts: 17346
Location: *** BEEP ...Dreaming of Africa... leave No message ; ) BEEP ***


flag
PostPosted: Thu Mar 21, 2013 2:08 am 
Post subject: Re: Case statement for Condition object

Please, post the SQL Syntax you have tried so far icon_wink.gif
_________________
Follow me on Twitter
Reading "The Design Of Everyday Things" by Don Norman
Focusing on Data Visualization, Design Thinking, SAP DesignStudio + scripting, SAP BI 4.x platform & architecture, SAP connectivity, Data Modeling, and SAP HANA Certified Associate
Back to top
americanmc
Principal Member
Principal Member



Joined: 30 Dec 2009

Posts: 341


flag
PostPosted: Thu Mar 21, 2013 6:49 am 
Post subject: Re: Case statement for Condition object

I have tried the syntax below gives error, missing operator:
Code:
@Select(Store\City)<>('Los Angeles','Austin') OR (case when @Select(Store\City) IN ('Los Angeles','Austin') then (case when @Select(Product\Lines) In ('City Skirts','City Trousers') then 'Los Angeles' when @Select(Product\Lines) IN ('Jackets') then 'Austin'  end) else ''  end)


need help to get it together.....thanks.... eek.gif

_________________
Did you think that man was created for nothing and that one day he would not have to return to his Lord?
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6696
Location: Connecticut, USA


flag
PostPosted: Thu Mar 21, 2013 8:15 am 
Post subject: Re: Case statement for Condition object

Well, first I'd replace the "<>" with "not in".

Second, the first part of the statement (before the OR) looks like a condition. The part after the OR producing a string (Los Angeles, Austin, or '').

Joe
Back to top
americanmc
Principal Member
Principal Member



Joined: 30 Dec 2009

Posts: 341


flag
PostPosted: Thu Mar 21, 2013 8:21 am 
Post subject: Re: Case statement for Condition object

Yes, I am saying, show all cities when they are not equal to los angeles or austin with the rest of the condition. Need some help to work right the Case statement.... banghead.gif
_________________
Did you think that man was created for nothing and that one day he would not have to return to his Lord?
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6696
Location: Connecticut, USA


flag
PostPosted: Thu Mar 21, 2013 8:27 am 
Post subject: Re: Case statement for Condition object

Still not really sure what your logic is, but maybe something like this?
Code:
@Select(Store\City) NOT IN ('Los Angeles','Austin')

OR

(
   case when @Select(Store\City) IN ('Los Angeles','Austin')
        then (case when @Select(Product\Lines) In ('City Skirts','City Trousers')
         then 'Los Angeles'
         when @Select(Product\Lines) IN ('Jackets')
         then 'Austin' 
         else ''
         end
        )
        else '' 
        end
   = ''
)
Back to top
americanmc
Principal Member
Principal Member



Joined: 30 Dec 2009

Posts: 341


flag
PostPosted: Thu Mar 21, 2013 8:39 am 
Post subject: Re: Case statement for Condition object

The syntax is not parsing.. even with ='' at the end. I keep getting error, missing operator.... crazy.gif
_________________
Did you think that man was created for nothing and that one day he would not have to return to his Lord?
Back to top
joepeters
Forum Fanatic
Forum Fanatic



Joined: 29 Aug 2002

Posts: 6696
Location: Connecticut, USA


flag
PostPosted: Thu Mar 21, 2013 11:45 am 
Post subject: Re: Case statement for Condition object

It worked for me.... Try creating a report with this object, then see what the generated SQL looks like. The @Select()s may be screwing something up.
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Semantic Layer / Universe Designer  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

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

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0298 seconds using 18 queries. (SQL 0.0033 Parse 0.0009 Other 0.0256)
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