cancel
Showing results for 
Search instead for 
Did you mean: 

Support for catch of prompt answer

0 Kudos

I work on a report based on a query with three prompts:

In my example below the prompts are:

  1. "Räkenskapsår//period"
  2. "Ansvarigt Kostnadsställe/grupp (Optional)"
  3. "Företag (Optional)"

I want to catch the user respons for each promptanswer.

With the function PromptSummary I catch:

" *** Query Name:Ack ***

    Räkenskapsår/period SEP 2015

    Ansvarigt Kostnadsställe/grupp (Optional)INFORMATION MANAGEME

    Företag (Optional)"

On Bob I found this:

Replace(Replace(
Substr( PromptSummary() ; Pos( PromptSummary() ; "    " ) ;
( Length(PromptSummary()) +2 - (Pos( PromptSummary() ; "    " )*NumberOfDataProviders())) / NumberOfDataProviders() )
; ";" ; ", ");"    ";"")


wich results in

"Räkenskapsår/period SEP 2015

Ansvarigt Kostnadsställe/grupp (Optional)INFORMATION MANAGEME

Företag (Optional)"

That's a start, but not what I want.

Instead I were trying with this:

=Substr(PromptSummary();Pos( PromptSummary() ; "period" )+7;8)

This gets exactly what I want: "SEP 2015"

Not so nice to search for a word in the promptstring, and not so nice to manually enter how many characters to add for start of substring.

When it comes to next promptanswer it's harder to perform:

With this try:

=Substr(PromptSummary();Pos( PromptSummary() ; "grupp" )+16;100)

I get not only the promptanswer, I get the hole tail of the string. Of course I could try to check how long the string is. But I am at the point to ask for a function I haven't found in webi:

I want a function that takes care of this, something like:

promptanswer(dataprovider;promptdimension;headeroption;userrespons)

In my case

prompt_period=promptanswer(query_A;räkenskapsår/period;No;Value)

which would give me "SEP 2015" from my example.

This function would be permissive for if the query or object would change name or structure. I think its cool with all the substringing but its very intolerant. 

Or is there any other way that I have found yet?

/Henrik

Accepted Solutions (1)

Accepted Solutions (1)

mhmohammed
Active Contributor
0 Kudos

Hey Henrik,

Create the below 3 variables to get the prompts answers separately. Make sure you have the exact same text as you see in the prompt, you can't miss anything, except for that "Optional," if you didn't add that manually.

  1. v_UserResponseforPrompt1 = Userresponse("Räkenskapsår//period")
  2. v_UserResponseforPrompt2 = Userresponse("Ansvarigt Kostnadsställe/grupp")
  3. v_UserResponseforPrompt3 = Userresponse("Företag")

Thanks,
Mahboob Mohammed

0 Kudos

HI,

Thank you! I really should have found this myself. Sorry!

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

Hi,

Have you tried with userresponse function?

=userresponse("Räkenskapsår//period")

replace the "Räkenskapsår//period" with he exact text of the prompt.


Amit

0 Kudos

Hi,

I thank you too.

It works fine!

Br,

Henrik