Adding up Downloads excessively due to multiple rows in Tabular

Hi All ,
We have fact table table which has data for Products that are taken down from the  App Store ,due to different reasons like App has risky key words , App has adult content etc  ...  We get the data from the staging table as below 
As the "reasonForTakeDown" column is having comma separated string , now we need to split this reason in to multiple rows taking Comma as the delimiter. So the first ,second and Third ProductGUIDs  have to repeated multiple
times to each "reasonForTakeDown" as shown below 
So in the above example if get the sum(Downloads) for the productKey 1 , then value is 300 where as the Staging value is 100.Same as with the productKey 2 , Sum(Downloads) from the fact table is 150 where as the Staging value is 50 and same case with ProductKey
3 as well . Downloads and Revenue numbers are getting inflated due to multiple rows 
I have a Tabular basing on the above fact table and having measures as "Downloads" and "Revenue" which are set to aggregation type as "SUM".  For the products like 1,2 and 3 we are
getting inflated numbers from cube when compared to Staging table due to the column ReasonForRemovalkey.
Now the problem is avoid the excess counting of downloads and Revenue by keeping multiple rows in fact table to satisfy reasonForRemovalKey Scenario . Can you help me out in writing an DAX so that anytime i will get the
correct number of downloads and revenue which are matching with staging table.
Approaches tried:
1)  Tried changing the aggregation type from SUM to Avg , but this aggregation type would give avg of downloads when the user selects multiple products. Suppose if the user selects ProductKey 1 & 2  then Avg downloads measure would be (100+100+100+50+50+50)
/ 6  = 75 , where as the original downloads sum is  100+50  = 150 .So Avg aggregation wont work for me.
2) I cannot divide the value of  downloads/NetRevenue for a product with the count of rows for that product in fact table.So that Sum(Downloads) and Sum(NetRevenue) would give me correct values.I cannot do this because , if want to get the downloads
for a TCR and a product then i would download measure share of that TCR but not the total downloads.
Hope i explained my scenario well. Thanks in advance

Spliting the message as it supports only two images per message .
Contd : 
Now the scenarios that needs to satisfied as below :
If user selects a product then we should get only the latest download and revenue out of the above multiple rows for a product from the tabular cube .i.e. as shown in the below snip  
Suppose if the user selects any other column instead of Product from the tabular cube , suppose if the user selects a date as a dimension on the row labels and Downloads ,Revenue as the measure from the Tabular cube , then it should only the max downloads
and Revenue for a product. i.e 
Now the same case as date with Requester also .If user selects requester then we should count only the downloads and revenue only once i.e. is the max downloads and revenue for a product and a requestor as shown in the below table  
RequestorKey Downloads Revenue 
1                    100             50
2                    150             40
3                    105             55
Hope i explained now clearly the scenarios.Thanks  you once again for your time 

Similar Messages

  • Downloading .xls file with multiple rows and Columns

    Hi ALL,
    I need to genarate .xls file with multiple rows and and Columns and sent as an email.Since our customer having Problem with .CSV files need to genarate .XLS file.
    Please do the needful.
    Thanks
    Madhu

    Hi Madhu,
    You might also consider using Excel Spreadsheet XML as the target structure (namespace is urn:schemas-microsoft-com:office:spreadsheet).  When you double-click the resulting xml on a PC it automatically opens with Excel. So, users don't see a difference.  It will open up a lot of options with formatting including creating multiple worksheets if you wanted to.  Best of all you can stick with XML.
    See my response in this thread:
    Re: Convert XML data into XLS 
    Thanks,
    -Russ

  • Password Masking & Background Color for Multiple Rows in Tabular Form

    Hi all,
    I have a requirement of making a column in Tabular form, having multiple rows, masked(password field). I also want to give bg color to this field indicating that its a mandatory field.
    I am unable to accomplish both at a time in my page. I am using Apex 3.2.
    Waiting for your valuable comments. Thanks,
    Regards,
    Sandeep

    APEX_ITEM API doesnot have a password function, but input fields of type password are available in HTML.
    So you would have to change the field type to password in JS
    That is from :
    <input type="text" ...change it to
    <input type="password" ...If you were using jQuery it would have been simpler, but to do it in native JS it is a bit more hard work.
    Anyway here goes (a quick check in a tabular form seens to work fine)
    var password_array=document.getElementsByName("f04");
    for(var i=0;i<password_array.length;i++)
       password_array.type = 'password';
    password_array[i].style.backgroundColor = 'RED';
    +Replace the "f04" with your password field's array name(use firebug to identify the field name)+
    Does that solve your problem ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I have multiple rows of bookmarks in the bookmark toolbar? I can't find any way to do this in 4.0. If I had know this wasn't possible in the new version, I would not have downloaded it.

    I have many bookmarks that I like to have readily available on the toolbar. With the older versions of Firefox, I was able to have multiple rows of icons that I grouped by topic. I have now wasted a lot of time trying to find a way to have multiple rows in version 4.0. I do not want to use the down arrow on the right.

    This can be done by adding a userstyle with the Stylish add-on.
    # First install the Stylish add-on - https://addons.mozilla.org/en-US/firefox/addon/stylish
    # Go to http://userstyles.org/styles/29428 and click on "Install with Stylish"
    # Restart Firefox and you should then have a multi-row bookmarks toolbar.

  • Adding and Deleting Multiple Rows or Columns

    How do you add or delete more than one row or column at a time.

    Robby! wrote:
    That's a great finding!
    I just wrote a feedback requesting a shortcut like this.
    It is a pity though that they desing it to work only if you select the header of the row/column. It should be enabled to work from within any cell in the table.
    Who wrote such an error ?
    These interesting shortcuts behave flawlessly even if the cursor was in D18 for instance.
    (a) I never saw them in the delivered resources.
    (b) they aren't responding to the OP's question which was about "Adding and Deleting Multiple Rows and Columns"
    Yvan KOENIG (from FRANCE vendredi 3 octobre 2008 18:39:01)

  • Adding a Multiple Rows Without Clearing Previous Row Details

    Dear All,
    I want to Add multiple rows at the same time in a matrix at the same time .My problem here is When i add the New rows to the matrix already added data need to remail in the matrix , I cant put Matrix.Clear or Datasource.clear.
    When   i add multiple rows previous row details is duplicated to next rows how to avoid thus
    Mohamed

    Hi,
    try this,
    If (pVal.ItemUID = "BTNUID") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
                            Dim fr As SAPbouiCOM.Form
                            Dim sel As Integer
                            Dim oMatrix1 As SAPbouiCOM.Matrix
                            fr = SBO_Application.Forms.Item(FormUID)
                            oMatrix1 = fr.Items.Item("mtx_136").Specific
                            fr.DataSources.DBDataSources.Item(2).Clear()
                            sel = oMatrix1.GetNextSelectedRow
                            oMatrix1.AddRow(1, sel)
                        End If
    "mtx_136" is your matrix ID
    and "BTNUID" is your button ID

  • Adding multiple rows

    How do I add multiple rows at once? Thanks,
    Owen

    See page 69 of the English edition of the user guide for the basics. If you've already been there and read that, you may be saying; yes, but I want to add them in the middle of my table. That's an extension of adding rows to the end of the table. Add as many rows as you need, at the end of the table. Then select the new rows by click-dragging across the row labels. Then grab the selection by one of the labels and pull to the left to separate the new rows from the rest of the table. Without letting go, move the cursor up the table to where you want the new rows to reside, just to the right of the labels, and you will notice that insertion marks, a split line, appear along the row borders under the mouse. When you reach the destination, let go of the mouse switch and the blanks will drop in where you want them.
    Jerry

  • Download multiple rows as pdf

    Can you download multiple rows at one time as pdf's or do you have to do them each individually?  It would save a ton of time. 
    Thanks,
    kristin

    Sorry this is not a supported feature.
    Andrew

  • Adding multiple rows to a cell?

    Is it possible to add multiple rows of text to a single cell? I am trying to create a workout log. Typicaly I would record several exercises with weights and repititions to a single days workout. Is this possible in Numbers?
    Suggestion?
    Thanks.

    Hi Dcneuro,
    I am trying to create a workout log. Typicaly I would record several exercises with weights and repititions to a single days workout.
    You can enter multiple lines of text in a cell... But I'm wondering why you would want to do that. A log would be more useful if you structure it like this, one exercise to a row and repeat the date where appropriate:
    If you structure it that way or similarly (rather than entering multiple lines in a cell) then you can then use Numbers to do the things spreadsheet software is designed to do: derive summary statistics, charts, etc.  The formulas in this summary table are:
    B2, copied down:  =COUNTIF(Log::B,A2)
    C2, copied down: =SUMIF(Log::B,A2,Log::D)
    D2, copied down: =AVERAGEIF(Log::B,A2,Log::D)
    E2, copied down: =AVERAGEIF(Log::B,A2,Log::C)
    Obviously these workout numbers make no sense. This is just a simple example to give you an idea of the kinds of things you can do if you structure your log properly.
    Also, have a look at the Running Log template (File>New>Personal>Running Log on the Mac, or on the iPad: + then Create Spreadsheet then scroll down to the Personal section).
    SG

  • Adding multiple rows or columns to a sheet

    Hi There,
    I'm new to this so pardon me please.......I've tried everything, I've looked everywhere..........does anyone know how to add in multiple rows or columns into the middle of a worksheet? There has to be a quicker way to throw in a quick 20 rows rather than just doing it one by one?????
    Frustratingly yours
    Morris

    Hello
    It seems that you missed a detail:
    +1. Highlight the number of columns you want to add before or after your insertion point.+
    +_2. Control click to get menu._+
    +3. Select "Add Columns Before" or "Add columns After" - whichever is appropriate.+
    without Control
    with Control depressed
    Yvan KOENIG (from FRANCE mercredi 6 février 2008 15:50:47)

  • Query for Multiple Rows as XML

    Ok I've seen this topic in the forums, but have failed to get this to work within my process. Basically I have a process that has a user fill out a form, and upon submittal the form writes it's information to a database (via a data connection within the form that invokes a separate process upon submittal.), once this is done the main process is invoked and it's first step is to query that same database and bring back the data in a lower (now exposed) portion of the form that contains certain fields that track the issue history. The query brings back the xml document and I store it in an xml variable (xml_output). I then take this information and use the Set Value object to assign the returned nodes values to the location fields in the form. This works if the query returns only one row. But once the form is moved beyond the initial Task Assignment, (first user), and query returns more than just one row, the added nodes to not show up on the form, i.e I still just get information about the first row in my form. From what I've read the form should be able to recognize the xpath expression, and bring back all the nodes, by in a sense using instance manager to create an instance for each node on the form. My question is how can I get this to work. Jasmin if your still out there... Help!
    Also We're using Adobe LiveCycle ES 8.0
    created the process using Workbench
    the form was reader enabled and saved as a dynamic PDF.
    Thanks
    Mike

    Ok have done the binding of the schema to the form, and I'm getting the information to flow as it's supposed to.  The problem I'm having now, (I know I'm having a bunch.) is that once I've placed the form into my process, and I use the set value operation to pre-fill information I get the form to flow, but the rest of the information that was previously filled in is blank.  So I have checked the variable and nothing wrong there.  It appears the problem is how I'm using the set value operation.  If I don't use the set value operation, the form retains it's information.  And if I use the set value by trying to set the subform value, the form retains it's information, but no pre-fill.  I'm going to try to be a little more detailed here.  The xml that is returned looks like this:
            0016-03-30
            Mike
            Public Works
            alone in the dark
            Type sleep
            -1
            Council
            FYI
            Important
    Flowed and positioned are actual subforms on the form that have their properties set as their names indicates.  The entire path is /form1/Page1/flowed/positioned .  The way I was able to get the form to flow correctly upon the injection of this xml data, was to bind the subforms in the form in this manner, positioned[*].  Designer didn't place the [*] for me so I had to do this myself.  But once I previewed the document, the form pre-populated and created the necessary number of subforms and placed information into the fields correctly.
    Now on the process side, I have created an xfaform variable that stores the form (bound to xsd.)  information, and another xml variable that stores the query return that looks like the xml listed above (has an xsd associated with it for navigating xpath).  My first operation performs the query (JDBC- Query Multiple Rows as XML) and stores it into the xml variable.  The next step of the process is the Set Value operation which is supposed to inject the xml data retrieved from the query into the form.  Initially I tried the an xpath similar to the following:
    /process_data/object/data/form1/page1/flowed/positioned = /xml_data/flowed/positioned.
    No dice.  On this one the form retains the information filled out by the user (didn't explain this earlier, the form is filled out first, and upon submittal the process starts.), but doesn't pre-populate the bottom part of the form.  Next I tried the following xpath:
    /process_data/object/data/form1/page1/flowed = /xml_data/flowed/positioned.
    This time it retained the form information which was filed in by the user, but the bottom part is becomes hidden!  Didn't understand this.  But I started to kinda think that I had to navigate he xpath in order to correctly inject the xml into the form.  That being said my next attempt was:
    /process_data/object/data/form1/page1 = /xml_data
    My thinking was that if on location, I stop at page1, the xml in the variable will allow it to navigate correctly through the form.  Well it worked, but too well.  The top part of the form is blank, but the bottom portion is pre-populated correctly.  Now I'm stuck.  Not sure how to get the rest of the information in the form.  I thought about creating variables form each of the fields and then re-populating them after the injection of xml, but that didn't seem practical.  I'm almost positive it's something I'm not doing correctly with xpath.  Anyway, thanks for all your help on this.
    Mike

  • Interactive report – column heading in multiple rows

    I am using interactive report. My question to the expert/guru&rsquo;s is: - How do I change column heading into multiple row with text wrap.
    For example:- My column heading is
    Is Employee Trained ? -------&gt; (single row display)
    I want to make it display like
    Is Employee
    Trained ? ------&gt; (Multi row display)
    Sagar

    Hi,
    What you could do is, disable the download csv function from IR (Interactive Report Attributes--> Search Bar-- Uncheck Download) and in the region header create a link and redirect it to another page which will have the csv report output.
    e.g. <a href="#"  onclick="javascript:redirect('f?p=&APP_ID.:3:&SESSION.::&DEBUG.:3::');"" >Download Report </a>
    Here I am redirecting the link to Page 3. On Page 3 create a sql report with the same query and make report template to csv. Thanks,
    Manish

  • How do I insert multiple rows from a single form ...

    How do I insert multiple rows from a single form?
    This form is organised by a table. (just as in an excel format)
    I have 20 items on a form each row item has five field
    +++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
    +Product| qty In | Qty Out | Balance | Date +
    +------------------------------------------------------------------------+
    +Item1 | textbox1 | textbox2 | textbox3 | date +
    + |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
    +------------------------------------------------------------------------+
    +Item 2 | textbox1 | textbox2 | textbox4 | date +
    + |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
    +------------------------------------------------------------------------+
    + Item3 | textbox1 | textbox2 | textbox3 | date +
    +------------------------------------------------------------------------+
    + contd | | | +
    +------------------------------------------------------------------------+
    + item20| | | | +
    +------------------------------------------------------------------------+
    + + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Database Structure
    +++++++++++++++++
    + Stock_tabe +
    +---------------+
    + refid +
    +---------------+
    + item +
    +---------------+
    + Qty In +
    +---------------+
    + Qty Out +
    +---------------+
    + Balance +
    +---------------+
    + Date +
    +++++++++++++++++
    Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
    Please anyone help me out, on how to get this concept started.

    Hello,
    I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
    Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
    Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
    I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
    Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
    In your code view, the Custom Trigger will look something like this:
    function Trigger_Custom(&$tNG) {
    if($tNG->getColumnValue("Item_1")) {
    $item1 = $tNG->getColumnValue("Item_1");
    $textbox1_1 = $tNG->getColumnValue("Textbox_1");
    $textbox1_2 = $tNG->getColumnValue("Textbox_2");
    $textbox1_3 = $tNG->getColumnValue("Textbox_3");
    $date1 = $tNG->getColumnValue("Textbox_3");
    $queryAdd = "INSERT INTO Stock_table
    (item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
    $result = mysql_query($queryAdd) or die(mysql_error());
    This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
    $tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
    // Add columns
    $customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
    There will be one for each field you created with the Custom Form Wizard.
    Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
    Hope this helps.
    Shane

  • Insert multiple rows in a table

    Hello Apex expert,
    I need help on insert multiple rows. it may look easy but I don't know how to do it.
    I have a table (with name found_table) which has these fields: found_ item_id, item_name, current_location, cost_center, tag_number. Also, I have a table (with the name transition) which has these fields: transition_id, found_item_id (FK to found_table), from_location, to_location, From_cost_center, to_cost_center, tag_number.
    I have an interactive report on found_table which I would like to add checkbox to all rows of the report. When the user checks any rows and press submit, I would like to send all these selected rows to another page which I have a form on transition table. The user will select a to_location and to_cost_center from this page (by the way from_location and from_cost_center and tag_number is the same as current_location and cost_center, tag_nuber from found_table, which I figured it out how to show those as a default in the new form). Now I want when a user selects the new location and cost center and press submit, all those selected rows be inserted in transition table with new locations.
    I read several threads on forum, but I could not find a solution for my problem. I will appreciate your help.
    Thanks,
    Atousa

    Hello again,
    I created a report with check box. I also added two selected list at the top of the region to select the location and cost center. Also, there is a transfer button(as submit) to insert the new data to table. Now I need the insert process. I tried different insert process but none of them is working for me:(((
    I created an example of what I need to do in the apex that you can take a look and give me some advise. The link is:
    What I need to do is:
    When a user selects several rows by using checkbox and selects To_LOCATION, and TO_COST_CENTER from selected list, and clicks on transfer, all the data should be insert in to another table with the name transition as follows:
    from found table to transition table
    found_item_id(pk) found_item_id (fk)
    current_location from_location
    cost_center from_cost_center
    tag_number tag_number
    selected list (to_location) to_location
    selected list (to_cost_center) to_cost_center
    Please help me on that. I appreciated.
    Atousa
    Edited by: Atousa.M on Jul 21, 2011 10:55 AM

  • Need Multiple Units of Measure for a given material due to multiple vendors

    Hello,
    We have a requirement where we must have multiple units of measue (each, box, case, pallet) for a given material.
    Background:
    We have multiple vendors for one SAP material number. We need to store 4 levels of units of measure for each vendor+material combination.
    Unit of Meaure levels
    1. Each
    2. Innerpack (ex: 12 each = 1 innerpack)
    3. Box (ex: 36 eaches = 1 box)
    4. Pallet (ex: 100 eaches = 1 pallet)
    Standard SAP allows in MM01 additional data --> Units of Measure only 1 Ea, Box, Plt, etc.
    Our requirement is to allow multiple Units of Measure due to multiple vendors providing the same material.
    So, our unique combination is by a Material+Vendor.
    We are considering adding the vendor name and vendor number to the material master --> additional data --> Units of Measure tab.
    Does this seem like a good solution? What impacts do you foresee with approach?
    Any alternatve solutions?
    We thought we could enhance the purchasing info records to allow multiple units of measure too but then we need to also add many fields to hold the weight, lenght, height, width, volume, country of origin, etc.
    Please recommend a best practice or solution to handle this requirement.
    Thanks in advance!!!

    Hi,
    Maintain the alternative units in Material Master in Additional Data -> Units of Measure section with proper conversion factors.
    Create individual info-records i.e. per mtl-vendor combination & in the info-record maintain the order unit, along with other details as required.
    Now when you create a PO, the details will be read from the info-record. To test the same, create them in your sandbox & see if it meets your requirement.
    Hope the above clarifies your query.
    Regards,
    Vivek

Maybe you are looking for