Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use DECODE and show Agent Description while passing the Agent Id in Parameter
skumar16jan
Dear All,<br />
<br />
Please advice on below points:<br />
i) How to show Agent Description when selecting Agent Code in Parameter form<br />
ii) How to show Date Range along with Report Title<br />
iii) How to use decode for ALL Agent Code in main query <br />
<br />
<span class='bbc_underline'><strong class='bbc'>PARAMETER DECLARED:</strong></span><br />
P_DATE_FROM<br />
P_DATE_TO<br />
P_AGENT<br />
<br />
<span class='bbc_underline'><strong class='bbc'><br />
MAIN QUERY:</strong></span><br />
SELECT POLICY_NO, AGENT_CODE, AGENT_DESC <br />
FROM DUAL <br />
WHERE agent_join_date between ? AND ?<br />
AND AGENT_CODE = DECODE(?,'ALL',%,P_AGENT)<br />
<br />
<span class='bbc_underline'><strong class='bbc'>PARAMETER WINDOW:</strong></span><br />
DATE FROM : 01/01/2012 DATE TO: 15/02/2013<br />
AGENT : A101-RAJKUMAR<br />
<br />
<span class='bbc_underline'><strong class='bbc'>OUTPUT:</strong></span><br />
<br />
AGENT LISTING <strong class='bbc'>FROM 01/01/2012 TO 15/02/2013</strong><br />
AGENT: <strong class='bbc'>RAJKUMAR</strong><br />
<br />
POLICY NUMBER AGENT CODE AGENT NAME <br />
TL2013101 A101 RAJKUMAR
Find more posts tagged with
Comments
Hans_vd
i) Not sure if this is possible - don't think so<br />
ii) Drag a dynamic text item to the report and write an expression like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>"Title from " + params["p_date_from"] + " to " + params["p_date_to"]</pre>
iii) this will work: AND AGENT_CODE = DECODE(?,'ALL', AGENT_CODE, P_AGENT)
skumar16jan
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="114654" data-time="1362044745" data-date="28 February 2013 - 02:45 AM"><p>
i) Not sure if this is possible - don't think so<br />
ii) Drag a dynamic text item to the report and write an expression like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>"Title from " + params["p_date_from"] + " to " + params["p_date_to"]</pre>
iii) this will work: AND AGENT_CODE = DECODE(?,'ALL', AGENT_CODE, P_AGENT)<br /></p></blockquote>