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

Register | Login 

Launch Works 
Launch Works (Opens a new window)  

General Notice: No events within the next 45 days.

Default value in @prompt (Date) - BOXIR2
1 members found this topic helpful
Goto page 1, 2  Next
 
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
Carole
Forum Member
Forum Member



Joined: 15 Sep 2006

Posts: 11
Location: Rennes (35)


flag
PostPosted: Fri Nov 10, 2006 8:31 am 
Post subject: Default value in @prompt (Date) - BOXIR2

Hi,

I need to have sysdate (defaut answer) when I use this prompt :
@Select(objet) >= @prompt('question','D','Calendrier\Date_jour',Mono,Free)
I have not find answer about this pb...

I find, under WebI XIR2 :
DATE_CREATION <= @prompt('Date_saisie : ','D',,Mono,Free,Persistent,,User:0)
Do you have the signification about "Persistent,,User:0" ?

Thanks !
Carole
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Mon Dec 18, 2006 5:06 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Hi

There is one trick you can do to have in prompt dynamic value as default. You can extend the syntax of prompt with default value let say "current month", then create condition object that would give you sysdate when "current month" is chosen. Parsing will give you error but it works I did it in XIr1
Back to top
Bhaumik Parikh
Principal Member
Principal Member



Joined: 07 Dec 2005

Posts: 167
Location: USA



PostPosted: Tue Jan 09, 2007 6:20 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Can you please elaborate more on this. I have a req where i have to put current month or last business day in prompt default value. How can i achieve using Designer and implement in WebI.

Thanks!

_________________
Bhaumik Parikh
BOXI R2 SP1
boxir2_chf
MHF (Sept 2006)
Backend: Teradata
Back to top
arpan
Senior Member
Senior Member



Joined: 22 Mar 2006

Posts: 71
Location: US


flag
PostPosted: Wed Jan 10, 2007 2:31 am 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

I really want to know about that too kindly provide the details
Cheers
-Arpan
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Tue Jan 16, 2007 5:59 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

That is what I did. Users wanted to have 2 prompts for year and month with default values PRIOR MONTH and CURRENT YEAR. What is more they wanted to choose values just from the list, not type in. So in the list of values of month and year I had to include labels PRIOR MONTH and CURRENT YEAR by making union (in Properties tab of object definition click edit/sql and paste following script):

SELECT DISTINCT lpad(table.MONTH,2,'0') FROM table union select 'Prior Month' from dual

Month was number before and now is converted to string. I suggest to create additional month and year objects apart from orginal ones, so that they would be used just for prompts, we do not want users to use them in queries since labels do not mean anything without prompt. This was the first step.

Then I created condition (I am showing just part of the script to give an idea) with prompts:

'Prior Month'= @Prompt('Month Equal to:','A','class\Month',Mono,Constrained,,{'Prior Month'},User:0)
and
to_char(table.MONTH)= to_char(add_months(sysdate,-1),'mm')

and

'Current Year'= @Prompt('Year Equal to:','A','class\Year',Mono,Constrained,,{'Current Year'},User:1)
and
table.YEAR=to_number(to_char(sysdate,'yyyy'))


when users choose those labels they will actually choose info from sysdate (for Oracle). I used extended prompt format so that every time you run report you get always labels as default values in prompts. Please remember if you are using month and year together, you should not forget about combination of labels and actual month and year numbers (e.g. 'Prior Month' + 2000; 05+'Current Year' etc.)

Hope this help. In my case it is working perfect. icon_biggrin.gif
Back to top
Bhaumik Parikh
Principal Member
Principal Member



Joined: 07 Dec 2005

Posts: 167
Location: USA



PostPosted: Tue Jan 16, 2007 6:12 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Apreciated much! Thanks a lot. This will be really helpful!

Thanks again!

_________________
Bhaumik Parikh
BOXI R2 SP1
boxir2_chf
MHF (Sept 2006)
Backend: Teradata
Back to top
BruceFocht
Forum Member
Forum Member



Joined: 05 Mar 2004

Posts: 15
Location: Kansas City


flag
PostPosted: Thu Jan 25, 2007 11:57 am 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Hello-
I'm interested in your @Prompt. I've been able to find documentation up to "constrained", but haven't found anything on next three place holders (...,,{'Prior Month'},User:0). Could you point me to some explanation of the three options available after free/constrained? Thank you very much.

You wrote:
@Prompt('Month Equal to:','A','class\Month',Mono,Constrained,,{'Prior Month'},User:0)
Back to top
Bhaumik Parikh
Principal Member
Principal Member



Joined: 07 Dec 2005

Posts: 167
Location: USA



PostPosted: Fri Jan 26, 2007 1:42 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Even I tried the way you have described. But i fail to understand the steps. Appreciate if you can write the steps to follow in detail.

Many Thanks!

_________________
Bhaumik Parikh
BOXI R2 SP1
boxir2_chf
MHF (Sept 2006)
Backend: Teradata
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Fri Jan 26, 2007 5:24 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Try to create simple report with prompt then view SQL. You can see all prompt's parameters. When

checked 'Keep last value selected' in SQL shows 'Persistent'

unchecked 'Keep last value selected' in SQL shows 'Not_Persistent'

checked 'set default value' in SQL shows {'<value>'}

putting number in 'User:0' you change the order of prompts(User:1,User:2 etc. ), first one is with 0

I tried to find something about this in pdfs but I could not.
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Fri Jan 26, 2007 5:27 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Which step should I describe?
Back to top
Bhaumik Parikh
Principal Member
Principal Member



Joined: 07 Dec 2005

Posts: 167
Location: USA



PostPosted: Mon Jan 29, 2007 1:24 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Ok I understod, the usage of Persistent and User:0. Now can you please describe in detail the step to follow for the same using Designer. I read about you creating a condition, but did not understand. Here is what i want to do:

@Select(Dates\Calendar Date) = @Prompt('Enter Date or Select Current Date for default','D','Dates\Calendar Date Prompt',mono,free, Persistent,{'Dates\Current Date'}, User:0)

What i have done above is I created an object which will return current date, then i use it with the other object to Union both of them so that the LOV of calendar date and current date objects are displayed together. Now I am trying to use current date LOV object in the clause after persistent. I dont know if this works or it has to be a date only.

If i try this in designer, it fails says invalid definition, and it does not even works in WebI. In the parenthesis after Persistent, I need to input default value of date. Can you suggest me the right way to do it.

Also, I understand that User:0, User: 1,... is just for the order of prompts. If i am incorrect please correct me!

Many Thanks for your continuous support.

_________________
Bhaumik Parikh
BOXI R2 SP1
boxir2_chf
MHF (Sept 2006)
Backend: Teradata
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Thu Mar 01, 2007 5:13 pm 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Using date in prompt you have got an option of using calendar with button current date. In this case I do not see sense using LOV for date. If I were an user I would not like to search for date in a huge list of all dates.

My suggestion is to use prompts for month and year and put in LOV labels: Current Month , Current Year

I assume that year column in DB is changing that is why we would need LOV with Year values from DB and label 'Current Year'. There are always 12 months (unless 13th is used on some purpose) so we can used fixed LOV.

First create object for Years and edit LOV SQL, put something like this
Code:
select table_name.year from table_name
union
select 'Current Year' from dual

check 'Do not generate SQL...'

now create object condition:
Code:
(
  lpad(UNIVERSE.MONTH,2,'0') = @Prompt('Month Equal to:','A',{'01','02','03','04','05','06','07','08','09','10','11','12','Current Month'},Mono,Constrained,,{'Current Month'},User:0)
  or
  (
     'Current Month' = @Prompt('Month Equal to:','A',{'01','02','03','04','05','06','07','08','09','10','11','12','Current Month'},Mono,Constrained,,{'Current Month'},User:0)
      and
     lpad(UNIVERSE.MONTH,2,'0')=to_char(sysdate,'mm')
  )
)


and


(   
   to_char(Table.YEAR)= @Prompt('Year Equal to:','A','Class\Year_wCY',Mono,Constrained,,{'Current Year'},User:1)
   or
   (
     'Current Year'= @Prompt('Year Equal to:','A','Class\Year_wCY',Mono,Constrained,,{'Current Year'},User:1)
      and
      Table.YEAR=to_number(to_char(sysdate,'yyyy'))   
   )
)


remember to hide Year object in universe, we do not want users to use it in query

When you parse there is error but in report is working fine icon_lol.gif
Back to top
titiy
Principal Member
Principal Member



Joined: 27 Apr 2006

Posts: 111



PostPosted: Thu Mar 08, 2007 8:20 am 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Marfi

In my case I have to get the last date from a table and this date is never the same from month to month.

I have been trying to put an object as the default but it returns the label of the object not the value.

Do you think we can do it?

Thank you

Yvon
Back to top
Marfi
Forum Enthusiast
Forum Enthusiast



Joined: 18 Dec 2006

Posts: 1477
Location: New York City


flag
PostPosted: Wed Apr 04, 2007 10:26 am 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

Have you tried putting max([date object]) instead of sysdate in my example? I think max([date object]) should retrive the last data value from db. Is this what you are looking for?
Back to top
titiy
Principal Member
Principal Member



Joined: 27 Apr 2006

Posts: 111



PostPosted: Tue Apr 17, 2007 9:39 am 
Post subject: Re: Default value in @prompt (Date) - BOXIR2

No what I was trying to achieve was to see the dynamic value not the label. Finally I was able to convince the users that was the only way I had to make it work the way they want.

Thank you

Yvon
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 2 All times are GMT - 5 Hours
Goto page 1, 2  Next
 
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.0601 seconds using 17 queries. (SQL 0.0146 Parse 0.0348 Other 0.0107)
CCBot/2.0 (http://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