Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 211 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
How to show a custom data when there aren't datas
Answers
-
Chris,
with union query i'll see in all cases dummy record...right?
or i'll see dummy record only when the first query is empty?
0 -
All cases. That's why said to maybe push the logic to the view itself.
a) then you dont need to build exception handling in the front-end and can just work normally
b) the heavy lifting and logic is offloaded to the source
0 -
Ciao Chris
Could it works?
create a new table on RPD and make an sql as source:
<span class="kwd">select</span><span class="pln"><br/> 'A'</span><span class="pun">,</span><span class="pln"> 2<br/></span><span class="kwd">from</span><span class="pln"> my view<br/></span><span class="kwd">where</span><span class="pln"> category </span><span class="pun">=</span><span class="pln"> </span><span class="pun">@</span><span class="pln">variable<br/></span><span class="kwd">union</span><span class="pln"> </span><span class="kwd">all</span><span class="pln"> </span><span class="pln"><br/></span><span class="kwd">select</span><span class="pln"><br/> </span><span class="lit">''</span><span class="pun">,</span><span class="pln"> -1</span><span class="pln"><br/></span><span class="kwd">where</span><span class="pln"> </span><span class="kwd">NOT</span><span class="pln"> </span><span class="kwd">EXISTS</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">SELECT</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> </span><span class="kwd">FROM</span><span class="pln"> my view </span><span class="kwd">where</span><span class="pln"> category </span><span class="pun">=</span><span class="pln"> </span><span class="pun">@</span>variable<span class="pun">)</span>
what do you think?
0 -
Pretty sure some hardcore db developer could write a super nice piece of code for you there Ask your database guys or whoever has initially written the view.
But yes your code should be fine as well.
0 -
Depending on volume of your data a SQL based table / Opaque view is going to under perform ... it's been mentioned 'do it on the source' - I second and third that advice.
0 -
Hi everyone:
On Sql, this works fine:
select
DCNN,VALUECPS,NETWORKOPERATOR
from OPERA_INV_BE_DEV.V_AMUSER_CPS
where DCNN = '000000'
union all --edit, of course it's quicker
select
'0',-1,''
where NOT EXISTS (SELECT DCNN,VALUECPS,NETWORKOPERATOR
from OPERA_INV_BE_DEV.V_AMUSER_CPS
where DCNN = '000000')
If i use this code in a new Table (Physical RPD), how can i pass variable?
where DCNN = @prompt_DCNN will it works?
How can i get dynamic results?
many thanks
0 -
"Depending on volume of your data a SQL based table / Opaque view is going to under perform" ... no predicate filtering. Using an opaque view brings ALL data back and let's BI server filter ...
0 -
hi to everyone...
first of all i'd like to thank you for support and your tips.
i solved issue with a view and a union all with a dummy record.
In analysis, i filtered with a rcount(1).
rcount(1) >= Case when la max(rcount(1)) >1 then 2 else 1 end
in this way i have what i need.
Thanks again guys
SB
0 -
Then please mark the comments that were helpful and mark the question answered - helps other who are searching with the same issue.
0