Formula in a narrative view

Hi Gurus,
Can you please help me with narrative views in OBIEE (11.1.1.5)?
I have a table that lists customer sales., e.g.
Customer Sales($mn) Rank
Cust1 800 1
Cust2 450 2
Cust3 350 3
Cust4 300 4
Cust5 40 5
Cust6 30 6
Cust7 20 7
Cust8 10 8
Total 2000
The requirement is to build a narrative view that uses different columns and totals. In this case, the narrative view should say:
Top *3* customers provide *80%* of the revenue.
(n = 3)
(80% = sum(sales) where rank in top n / total sales) = (800+450+350)/2000*100
I can't find a way to incorporate formulas. I can call the sales column (@2) but not able to put the calculation in the narrative view. Has anyone done such a thing before or knows how to do it?
Thank you!!

Thank you, HM... that worked great!!
I have another quick follow up - is there a way to refer to individual values in the result set in a narrative? For example, based on the same table:
Customer $mn Rank
Cust1 800 1
Cust2 450 2
Cust3 350 3
Cust4 300 4
Cust5 40 5
Cust6 30 6
Cust7 20 7
Cust8 10 8
Total 2000
I want to create another narrative that is the ratio of sales of the first and third ranked customer; i.e., the narrative I am trying to build is:
No. 3 has to increase sales by *2.28* times to equal No. 1.
(2.28 = 800/350)
Is that possible, given that my table is sorted by rank?

Similar Messages

  • Issue filtering a report (based on narrative view) with a dashboard prompt.

    I used HTML and java-script codes in narrative view to solve the issue of "linking different reports on selecting values from a drop-down". A new issue has cropped up due to that implementation. The issue is that i can't attach a dashboard prompt to such a report. This means, when i put this report on a dashboard page with a dashboard prompt to help filter the report, the report does not gets filtered (it does not seems to be connected to the dashboard prompt).
    Has anyone faced this issue before? If yes, please let me know how to tackle it at the earliest.
    Regards,
    Ramil

    Hi,
    sorry , i could not solve the problem. the below case statement i put in the formula of a date column but i got some syntax error.One more thing is case statement is appearing in the select query not in where condition. Do u mean to say if i will put the same column as is prompted then it will come in where condition.
    Could u plz help me where i am doing wrong .
    case when '@{Period}'='Weekly' then Alerts."Creation Date and Time"  between  '@{PStartDate -7}' and  '@{PStartDate}' end
    [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <between>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: SELECT Alerts."Business Domain(s)", Alerts."Closing Action Type", Alerts.Closer, case when ''='Weekly' then Alerts."Creation Date and Time" between '' and '' end FROM "Common Productivity Reports for Alerts"

  • Narrative view current year

    Hi..
    How could I view the current year by default in narrative view. I have used the following code
    Year @{pvYear}*{year(current_year)*
    Here pvYear is my presentation variable. At first time it shows Year year(current_year) in my report. When I use the prompt its shows my selected year.
    Right now I have hard coded as
    Year @{pvYear}{2009}
    Thanks
    Mohan

    These are the step you have to follow
    create one dummy column in the report and write the following formula
    *case when @{year}=null then year(current_date) else @{year} end* and refer that column in the narrative view
    and in the dashboar prompt defualt to drop down select repository variable and give the current year repository variable there
    or choose SQL results and write the following formula
    * SELECT case when 1=0 then "- Actual Start Date"."Start Year" else Year(current_date) end FROM Activities*
    hope it helps you
    Regards
    Naresh

  • Narrative view query

    Is it possible to use a condition in a narrative view.
    I have a summary report in which if the user clicks Month I should get in the list report's narrative view as Data for that month.
    same thing goes for year and quarter. Is it possible?

    Hi,
    >I have a summary report in which if the user clicks Month I should get in the list report's narrative view as Data for that month.
    Can you be clear on this.
    User clicks Month value in month column?
    So are you navigating to any other page when he clicks on that value?
    If you are navigating to drill report,then pull one dummy column in that report criteria and hide it.Write formula to fetch date in fx of this dummy column,make month column as prompted in the drill report.Show that date fetched in narrative view as @n,n is position of that hidden column in criteria(@1 if its position is 1 from left).
    Regards,
    Srikanth

  • I want to display the narrative view as All Choices

    Hi Experts,
    If ‘All choices’ option is selected, I want to display the narrative view as All Choices.
    How do I achieve it?
    Waiting for your reply....
    Regards,
    Sathyan

    Hi Sathyan,
    Set a presentation variable for that prompt.
    and in request, go to the column formula,
    CASE WHEN '@{pv_var}' IS NULL THEN 'ALL CHOICES' ELSE col_name END
    Regards,
    Raghu

  • Data in a narrative view.

    Sorry if this is simple. Just want to display the multiple values from a report prompt, not dashboard prompt, in the report. My effort has taken me to the narrative view and am using @12 to display the values in the column which has been filtered. But it is listing the values many times for each row. Can I use the narrative to display only distinct @12s or is there a better way to get the prompt values into the report. Thanks

    You can do this with pivot table, it is not possible with Narrative.
    1. Create pivot view for same report
    2. exclude all the columns other than the column you want to show
    3. Put the column in measures
    4. duplicate the column, drag the duplicate column in to columns and hide
    5. drag measure labels into Rows
    6. apply aggregation to First on column in measures.
    it works, I will blog it shortly with screen shots soon.

  • Problem with javascript in narrative view

    Hi gurús!
    I'm trying to put some conditional logic in a narrative view of my analysis. I found some tips, and wrote that:
    <script>
    if('@{FIN01TIME}{ }'=='Period')
    document.write("[b]Fiscal Year : [/b]@1       [b]Fiscal Quarter : [/b]@2       [b]Fiscal Period : [/b]@3       [b]Roll Up : [/b]@{FIN01ND}{ }      [b]Cost Center : [/b]@{FIN01CC}{ }       [b]Currency : [/b]@{FIN01CURR}{ }")
    if('@{FIN01TIME}{ }'=='Quarter')
    document.write("[b]Fiscal Year : [/b]@1       [b]Fiscal Quarter : [/b]@2       [b]Roll Up : [/b]@{FIN01ND}{ }      [b]Cost Center : [/b]@{FIN01CC}{ }       [b]Currency : [/b]@{FIN01CURR}{ }")
    if('@{FIN01TIME}{ }'=='Year')
    document.write("[b]Fiscal Year : [/b]@1       [b]Roll Up : [/b]@{FIN01ND}{ }      [b]Cost Center : [/b]@{FIN01CC}{ }       [b]Currency : [/b]@{FIN01CURR}{ }")
    </script>
    All works good, but the problem happens when I "click" on paging buttons of my analysis (see attached image: javascript_problem_paging.png). After click, it leaves me to a blank page with only narrative view content. Also, displays "error on page" warning in status bar (see attached image: javascript_problem_afterclick.png)
    I believe that this issue happens with "onclick" event of javascript. I tried to disable it, but still not works.
    Any help will be appreciated.
    Thanks for your time!
    Regards,
    Fabian

    Hi all!
    I get my own answer, jeje.
    Instead of use "document.write..." I put another narrative view with a <div> control and set it's content by "document.getElementById(..).innerHTML = "(same HTML code)""
    It works perfect! I hope that this achievement helps somebody else.
    Regards,
    Fabian

  • Pagination in a Narrative view?

    Is there a way to use pagination controls in a Narrative view?
    I'm looking for either an out-of-the-box way to turn this on (maybe I'm just not seeing it?), or if that's not supported, then any ideas on how it might be otherwise implemented.
    Is this do-able at all? Am I just not seeing the place to active this?
    Thanks very much.

    Thank you, HM... that worked great!!
    I have another quick follow up - is there a way to refer to individual values in the result set in a narrative? For example, based on the same table:
    Customer $mn Rank
    Cust1 800 1
    Cust2 450 2
    Cust3 350 3
    Cust4 300 4
    Cust5 40 5
    Cust6 30 6
    Cust7 20 7
    Cust8 10 8
    Total 2000
    I want to create another narrative that is the ratio of sales of the first and third ranked customer; i.e., the narrative I am trying to build is:
    No. 3 has to increase sales by *2.28* times to equal No. 1.
    (2.28 = 800/350)
    Is that possible, given that my table is sorted by rank?

  • Script result not showing up in narrative view

    I'm making a org chart as a narrative view.
    If I do not tick "Contains HTML Markup" the result of the script is displayed. If I cut-n-past that content into a HTML file it display the result I'm looking for. However if I tick "Contains HTML Markup" the narrative view displays as empty.I have Attached two screenshots displaying this.
    Any ideas what I'm not doing right? Have I forgotten some config to enable scripts in narrative view?
    this is the script I'm using
    Prefix:
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
        <script type='text/javascript'>
    if(document.URL.indexOf("saw.dll?Answers") == -1) {
          google.load('visualization', '1', {packages:['orgchart']});
          google.setOnLoadCallback(drawOrgChart);
          function drawOrgChart() {
    if(document.URL.indexOf("saw.dll?Answers") == -1) { 
          var data = new google.visualization.DataTable();
            data.addColumn('string', 'Name');
            data.addColumn('string', 'Manager');
            data.addColumn('string', 'ToolTip');
            var myOrgArray=[];
            var tempStr = "";
    Narrative:
    myOrgArray.push(["@1","@3","@2"]);
    Postfix
         data.addRows(myOrgArray);
            var chart = new google.visualization.OrgChart(document.getElementById('div_orgchart'));
            chart.draw(data, {allowHtml:true});
        </script>
        <div id='div_orgchart'></div>

    Yes, sorry, client is obviously sufficient as well.
    Just tried your code and same behaviour here and it doesn't do squat either. Can't deep-dive into that code right now but it's definitely code-related issue rather than a browser one for example.
    Thought about trying d3js? Would be easier to reproduce for me as I use that more often than Google's data-munching pipe that pushes all your data through Google Analytics
    Edit: Clicked too quickly. Wanted to point you to the SampleApp dashboard page which hosts the example I meant: http://slc02oka.oracle.com:7780/analytics/saw.dll?Dashboard&PortalPath=%2Fshared%2F02.%20Visualizations%2F_portal%2F2.32…
    Username Prodney
    Password Admin123
    Edit 2: Jesus I really should stop clicking "Save Reply" just to not lose it. Simply show your analysis on a dashboard and you're fine. It'll work.

  • Unable to pass  presentation variable value to Go url with narrative view

    I am trying to use navigate option of Go URL. I have Dashboard prompt with presentation variable (pv)defined. I am able to see the pv value in compund view but unable to see in Narrative view. Any thoughts?

    Check my blog entry here http://oraclebizint.wordpress.com/2007/11/26/oracle-bi-ee-101332-same-page-navigation-drills-and-passing-parameters/. It has an example.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Presentation variable in iframe/narrative view/Go URL

    I am able to see the peresentaion variable declared in Dashboard Prompt in narrative view.
    But when I put in iframe with narrative in Go URL then i am not able to filter the report based on presentation variable Values..." The page throws error
    'saw.aViewsToRefersh.all' is null or not an object.'

    Do you get that error if you remove the presentation
    variable column (@n). Does the a simple iframe work.
    Also, how are you referring the presentation variable
    in the iframe. I hope you are referring via a dummy
    column.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com
    Yes the simple iframe work well in the browser. As I am trying to run report based on the dashboard prompt. I have declared presentation variable in Dashboard prompt and referring the presentation variable in the iframe via a dummy column. when i click on 'Go' of dashboard prompt after selecting the value in dropdown list, I see the error on left bottom most of Internet Explorer Showing " Done" is null or not any object. also i see javascript:void(null). I assume that the variable value is not getting passed to parameters i have given in Go URL

  • How to display presentation variable in a narrative view

    Is there any way that we can display the prompt value stored in a presentation variable in the narrative view?

    Hi,
    use this synatx @{PRESENTATION_VARIABLE}{'Default'}
    Regards,
    Gianluca

  • Can I write a Java Program in Narrative view and make it work?

    Hi All,
    I got a requirement which demands me to write a java program in narrative view. As per my knowledge its not possible..........but do you guys have any work around or any other way to get that java program run when the report runs and the out must be seen on the dashboard???
    Thanks in advance,
    DK

    Joe thanks for the reply. I would like to communicate with a JavaScript API (MapQuest) by declaring a Proxy server and port number to communicate. Or I can directly use Java SDK to display maps.
    This is more a general question. If I can execute a java program then I will try doing many things.
    Thanks,
    DK

  • Reg-Narrative View Case

    I have two columns A , B as two prompts.
    I am passing Values of A, B to Narrative View.
    I f A is selected A value should pass to Narrative View
    I f B is selected B value should pass to Narrative View
    FYI :User wont select both at a time.
    Thanks
    NK

    If you are using presentation variables then just call them using @{VarName} in Narrative view
    like @{A}@
    based on the value the view would show it.
    If you are not using presentation variables then
    use those A and B columns in the report
    and call them in Narrative view using their positions like @1@2
    where 1 the position of A from left in criteria
    Edited by: Srini VEERAVALLI on Apr 1, 2013 11:31 AM

  • The current xml is invalid upon using external charts in narrative view

    Hi,
    I always get following message when embedding amcharts or google charts using narrative view. Once saved, it is not possible to any more to edit the narrative view. However, the report works fine, the chart is shown, but not editable.
    cheers,
    Mark
         Error Displaying Results
    The current xml is invalid with the following errors: Bad xml instance! <?xml version="1.0"?> <saw:report xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sawx="com.siebel.analytics.web/expression/v1.1" xmlVersion="200810080"><saw:criteria xsi:type="saw:simpleCriteria" subjectArea="&quot;QC4Agility&quot;" withinHierarchy="true"><saw:columns><saw:column xsi:type="saw:regularColumn" columnID="c5f655b89c322bce7"><saw:columnFormula><sawx:expr xsi:type="sawx:sqlExpression">&quot;Dim - RUN&quot;.&quot;RUN Status&quot;</sawx:expr></saw:columnFormula></saw:column><saw:column xsi:type="saw:regularColumn" columnID="c9de76acdb49ee65f"><saw:columnFormula><sawx:expr xsi:type="sawx:sqlExpression">&quot;Fact - req_test_run&quot;.&quot;# REQs&quot;</sawx:expr></saw:columnFormula></saw:column><saw:column xsi:type="saw:regularColumn" columnID="c9fe9f1713d290812"><saw:columnFormula><sawx:expr xsi:type="sawx:sqlExpression">&quot;Fact - req_test_run&quot;.&quot;# TESTs&quot;</sawx:expr></saw:columnFormula></saw:column></saw:columns><saw:filter><sawx:expr xsi:type="sawx:logical" op="and"><sawx:expr xsi:type="sawx:comparison" op="equal"><sawx:expr xsi:type="sawx:sqlExpression">&quot;Dim - REQ&quot;.&quot;REQ Target release&quot;</sawx:expr><sawx:expr xsi:type="xsd:string">1.0</sawx:expr></sawx:expr><sawx:expr xsi:type="sawx:comparison" op="lessOrEqual"><sawx:expr xsi:type="sawx:sqlExpression">&quot;Dim - REQ&quot;.&quot;REQ nCycle&quot;</sawx:expr><sawx:expr xsi:type="sawx:variable" op="server">CurrentCycle</sawx:expr></sawx:expr><sawx:expr xsi:type="sawx:comparison" op="notNull"><sawx:expr xsi:type="sawx:sqlExpression">&quot;Dim - RUN&quot;.&quot;RUN Status&quot;</sawx:expr></sawx:expr></sawx:expr></saw:filter></saw:criteria><saw:views currentView="0"><saw:view xsi:type="saw:compoundView" name="compoundView!1"><saw:cvTable><saw:cvRow><saw:cvCell viewName="titleView!1"><saw:displayFormat><saw:formatSpec/></saw:displayFormat></saw:cvCell></saw:cvRow><saw:cvRow><saw:cvCell viewName="tableView!1"><saw:displayFormat><saw:formatSpec/></saw:displayFormat></saw:cvCell></saw:cvRow><saw:cvRow><saw:cvCell viewName="dvtchart!1"/></saw:cvRow><saw:cvRow><saw:cvCell viewName="narrativeView!1"/></saw:cvRow></saw:cvTable></saw:view><saw:view xsi:type="saw:titleView" name="titleView!1"/><saw:view xsi:type="saw:tableView" name="tableView!1"><saw:edges><saw:edge axis="page" showColumnHeader="true"/><saw:edge axis="section"/><saw:edge axis="row" showColumnHeader="true"><saw:edgeLayers><saw:edgeLayer type="column" columnID="c5f655b89c322bce7"/><saw:edgeLayer type="column" columnID="c9de76acdb49ee65f"/><saw:edgeLayer type="column" columnID="c9fe9f1713d290812"/></saw:edgeLayers></saw:edge><saw:edge axis="column"/></saw:edges></saw:view><saw:view xsi:type="saw:dvtchart" name="dvtchart!1"><saw:display type="pie" subtype="default" renderFormat="flash" mode="online" xAxisLiveScrolling="false" yAxisLiveScrolling="false" clientEventEnabled="false" animateOnDisplay="true"><saw:style barStyle="default" lineStyle="default" scatterStyle="default" fillStyle="default" bubblePercentSize="100" effect="2d"/></saw:display><saw:canvasFormat height="330" width="640" showGradient="true"><saw:dataLabels display="always" label="nameValue" position="below" transparentBackground="true" valueAs="default" abbreviation="default"><saw:textFormat fontSize="14"/><saw:dataFormat xsi:type="saw:number" commas="false" negativeType="minus" minDigits="0" maxDigits="0"/></saw:dataLabels><saw:gridlines default="true"><saw:horizontal><saw:major visible="false"/><saw:minor visible="false"/></saw:horizontal><saw:vertical><saw:major visible="false"/><saw:minor visible="false"/></saw:vertical></saw:gridlines><saw:title mode="auto"><saw:caption/></saw:title></saw:canvasFormat><saw:selections><saw:categories><saw:category><saw:columnRef columnID="c5f655b89c322bce7"/></saw:category></saw:categories><saw:measures showMeasureLabelsOnCategory="false"><saw:column measureType="pie"><saw:columnRef columnID="c9de76acdb49ee65f"/></saw:column></saw:measures><saw:seriesGenerators><saw:seriesGenerator/><saw:measureLabels/></saw:seriesGenerators></saw:selections><saw:legendFormat position="none" transparentFill="true"><saw:textFormat/></saw:legendFormat><saw:seriesFormats><saw:seriesFormatGroup name="pie"><saw:seriesFormatRule><saw:seriesCondition columnID="c5f655b89c322bce7" position="0"><saw:condition><sawx:expr xsi:type="sawx:comparison" op="equal"><saw:columnRef columnID="c5f655b89c322bce7"/><sawx:expr xsi:type="xsd:string">Failed</sawx:expr></sawx:expr></saw:condition></saw:seriesCondition><saw:visualFormats><saw:visualFormat color="#FF0000"/></saw:visualFormats></saw:seriesFormatRule><saw:seriesFormatRule><saw:seriesCondition columnID="c5f655b89c322bce7" position="1"><saw:condition><sawx:expr xsi:type="sawx:comparison" op="equal"><saw:columnRef columnID="c5f655b89c322bce7"/><sawx:expr xsi:type="xsd:string">Passed</sawx:expr></sawx:expr></saw:condition></saw:seriesCondition><saw:visualFormats><saw:visualFormat color="#B0C060"/></saw:visualFormats></saw:seriesFormatRule></saw:seriesFormatGroup></saw:seriesFormats></saw:view><saw:view xsi:type="saw:narrativeView" name="narrativeView!1"><saw:prefix><saw:caption fmt="html"><saw:text/></saw:caption></saw:prefix></saw:view></saw:views><parsererror xmlns="http://www.w3.org/1999/xhtml" style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black"><h3>This page contains the following errors:</h3><div style="font-family:monospace;font-size:12px">error on line 6 at column 430: Sequence &#39;]]&gt;&#39; not allowed in content </div><h3>Below is a rendering of the page up to the first error.</h3></parsererror></saw:report> Line:2, Col:5482, Unknown element 'parsererror' Line:2, Col:5482, Attribute 'style' is not declared for element 'parsererror' Line:3, Col:98, Element 'parsererror' is not valid for content model: '((criteria,views,prompts,listOptions),segmentOptions)'
    Error Details
    Error Codes: EIRWWH9E
    Location: saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    narrative view used for test:
    Prefix
    <script type="text/javascript" src="http://extra.amcharts.com/public/swfobject.js"></script>
    <div id="amcharts_1308229514469">You need to upgrade your Flash Player</div>
    <script type="text/javascript">
         var so = new SWFObject("http://extra.amcharts.com/public/ampie.swf", "ampie", "500", "400", "8", "#FFFFFF");
         so.addVariable("path", "ampie/");
         so.addVariable("chart_settings", encodeURIComponent("<settings><precision>0</precision><background><alpha>100</alpha><border_alpha>20</border_alpha></background><legend><align>center</align></legend><pie><y>50%</y><start_angle>0</start_angle><outline_color>FF0000</outline_color></pie><data_labels><show><![CDATA[<b>{title}, {percents}%</b> ({value})]]></show><max_width>150</max_width></data_labels><labels><label lid='0'><text>DIR</text><x>10</x><text_color>000000</text_color><text_size>28</text_size><align>center</align></label><label lid='1'><text>S&amp;E</text><y>220</y><text_color>FFFFFF</text_color><text_size>28</text_size><align>center</align></label></labels></settings>"));
         so.addVariable("chart_data", encodeURIComponent("<pie>
    *Narrative*
    <slice title='United States'>19544</slice>
    *Postfix*
    </pie>"));
         so.write("amcharts_1308229514469");
    </script>

    I think it's a problem with your CDATA section. Take that bit out and test again to prove whether it's the cause.
    Paul

Maybe you are looking for