I work on a report based on a query with three prompts:
In my example below the prompts are:
- "Räkenskapsår//period"
- "Ansvarigt Kostnadsställe/grupp (Optional)"
- "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