Inter-row rules

Hi,
I have product and stores dimensions, some measures and a custom measure 'Obs'. One of the measures is 'Type', others are 'saling_price' and 'cost_price'.
Now I have to run a model and every time a rule is not satisfied by one product/store, the 'Obs' column must be updated with the reason why it failed.
Here is an example of one simple rule (horizontal rule):
- For each product,store: IF cost_price > saling_price THEN Obs='ERROR 1';
What I don't now is how to handle rules that require inter-row calculation (vertical rules). For example: 'All Type 1 products must have a saling_price lower than Type 2 products'.
Is it possible to model this type of rules?
Thanks for the help,
Ricardo

Hi
It would be greate if you put an example on apex.oracle.com
Best Regards, Kostya

Similar Messages

  • While defining the Inter company rules unable to select Trading partner lov

    n case implementing new company
    While defining the Inter company rules user unable to select Trading partner Legal entities from Trading partner LOV
    Note:1
    I have checked the DOC ID 1113834.1, bur also there are no any Inter company Exception defined the Inter company Exception does not have any Exceptions
    Please advice

    in search lov write the first words+% and enter

  • Inter row calculation

    Hi all,
    In my region select query (SELECT A,B,C,D FROM SOURCE ).
    I have edited the Report attributes to have 'Select Static LOV' in column A and 'Select Static LOV' in column B.
    These Static lovs for A & B are distinct column(different) value of a table X.
    Now i want Col D in Tabular report to be calculated on the base of values in A & B
    Is there a way to do that, any help will be highly appreciated

    Hi
    It would be greate if you put an example on apex.oracle.com
    Best Regards, Kostya

  • Define rules for tables in personas

    Hello,
    I'm having this strange issue in personas right now that is leaving curious for what is actually going wrong.
    So I want to hide every row that is not having the "tick mark" in the box. See picture for personas rule that I have defined. A is the column with the tickable box.
    Before i save the flavor it looks like personas is actually trying to do the rule that I have defined. The rows that don't have the tick mark is now grey.
    But when I later save the flavor and opens up the table this happens. All the rows are now grey no matter what.
    So the result is not very satisfying. And to top it off it looks like its working befor you save the flavor.
    Anyone got any ideas on this one?
    Best Regars,
    Oskar Söderlund

    Oskar,
    I would first isolate this into two things to study:
    1. Does the "Hide row" rule work correctly without check box? - Find another table which does not contain the check box, but some elements. Then set a rule, eg, if value equals to xx, then "Hide rows".  Now check if the grey background works as it is supposed to be.
    2. For the use of the ckeck box in table, is "is empty" the right condition that should be used? For a normal check box on UI, it would be "check" method which will sets the tick.
    Would this help? Good luck,
    Dong Zhu

  • SAS vs Oracle comparison for statistical modeling

    Hi,
    I am working on a project that require a lot of statistical analysis. as we are in a preliminary phase of determining which way to go, someone recommended to use SAS.
    would you be able to share your experience/comments related to SAS vs Oracle comparison when it comes down to using statistical models within each of these applications. and is there a list of all statistical models that Oracle offers (it could be handy to compare it with our requirements.)
    Plus, would also like to know if there is a way to test these models... just like APEX is offered free for testing purposes @ apex.oracle.com
    Thanks in advance

    You don't go into much detail regarding what types of statistical technques that you might want to use. First, Oracle both partners with SAS and competes and SAS. In terms of Oracle technology for statistics and models, we ship about 50 basic statistical technques with EVERY Oracle Database for free. Those stats include below. See SQL Reference Guide for details:
    Descriptive Statistics
    DBMS_STAT_FUNCS: summarizes numerical columns of a table and returns count, min, max, range, mean, median, stats_mode, variance, standard deviation, quantile values, +/- n sigma values, top/bottom 5 values
    Correlations
    Pearson’s correlation coefficients, Spearman's and Kendall's (both nonparametric).
    Cross Tabs
    Enhanced with % statistics: chi squared, phi coefficient, Cramer's V, contingency coefficient, Cohen's kappa
    Hypothesis Testing
    Student t-test , F-test, Binomial test, Wilcoxon Signed Ranks test, Chi-square, Mann Whitney test, Kolmogorov-Smirnov test, One-way ANOVA
    Distribution Fitting
    Ranking functions
    rank, dense_rank, cume_dist, percent_rank, ntile
    Window Aggregate functions (moving & cumulative)
    Avg, sum, min, max, count, variance, stddev, first_value, last_value
    LAG/LEAD functions
    Direct inter-row reference using offsets
    Reporting Aggregate functions
    Sum, avg, min, max, variance, stddev, count, ratio_to_report
    Statistical Aggregates
    Correlation, linear regression family, covariance
    Linear regression
    Fitting of an ordinary-least-squares regression line to a set of number pairs.
    Frequently combined with the COVAR_POP, COVAR_SAMP, and CORR functions
    Kolmogorov-Smirnov Test, Anderson-Darling Test, Chi-Squared Test, Normal, Uniform, Weibull, Exponential
    Additionally, Oracle has a Database Option called Oracle Advanced Analytics which delivers 12+ hi-performance, data mining algorithms (e.g. clustering, decision trees, regression, association rules, anomaly detection, text mining, etc.) as native SQL functions that can be called from SQL, the R language or the Oracle Data Miner workflow GUI (ships with SQL Developer). There is a LOT more information on the OAA Option here http://www.oracle.com/technetwork/database/options/advanced-analytics/index.html?ssSourceSiteId=ocomen.
    Hope this helps. cb

  • Lexicographic image processing

    I want to process the array of an image lexicographically (meaning reading as you write, so from left to right). Normal arithmatic functions (division, multiplication etcetera) multiply the entire array, but I want to push the top-left pixel through my algorithm, and then the one to the right of that, and after that one the one to the right of that, up until the last pixel, and then it starts with the pixel one row beneath the first one all the way on the left.
     To illustrate, imagine an image of 12 X 16 pixels:
    I want to calculate what value each pixel is supposed to have. I do this by comparing the actual value with the value I want. I calculate the value it needs to be at a certain pixel by looking at how far it is from the origin. The origin is in the center:
    The distance then from the origin to the actual pixel is this:
    The length of this 'vector' is then calculated by splitting it into a horizontal and vertical part:
    The length is then the the x-coordinate squared and the y-coordinate squared added together and then the root of that number is taken. So that's basically the theorem of Pythagoras. I know that in this case, the length found is not the real length, because you use x=1 and y=1. So first off I subtract 8.5 from the x value and 6.5 from the y-value before going any further.
    But I want to process the pixels in the order of y=1 x = 1, 2, 3, 4, 5, 6, 7, 8 etcetera and then y=2 x=1, 2, 3, 4, 5, 6, 7 etcetera. That is exactly what lexicographical processing is. But how can I get this to work? In my VI you can see how I am currently exporting just the numbers of the total size of the image (or frame of a video), but I want to process them one by one. I looked up some helpful Labview files that do something similar, like the 'Check Pixel Value' VI but there you have to manually scroll through the data. I want it to happen automatically.
    So how can I process pixels of an image lexicographically?
    Solved!
    Go to Solution.
    Attachments:
    USB Webcam n-bit to corrected 1 bit.vi ‏59 KB
    Check Pixel Value-2013.vi ‏31 KB

    Yes, I do have a 2D array. I use the IMAQ Vision VI's to get my webcam to run. The solution is rather simple in that sense, yes.
    But here is the deal though: the comparing with the Lorentzian function returns me a value. That is rounded to either a 0 or a 1, because it will be the pattern used for a Digital Micromirror Device (DMD). This induces an error. In order to make up for that, I need to correct it using neighbouring pictures (if a pixel is surrounded by 8 pixels, then the diagonal pixels are primarily used for this). I tried something similar in which I split it into 'rows' and process that, but that ofcourse removes the option to resolve the induced error.
    The 'easiest' way is to split it into 1024 times 728 pixels and hook all of these up to the formula and connect each of them to their corresponding pixels, but that would take several months, so that's not an option.
    Could you be more concrete in how you would do this? I tried something similar but thought, because of that error resolving, it would remove the option to work in this way, because it doesn't allow 'inter-row interaction'.
    To give you some background:
    I want to use a DMD to create a laser with a top-hat wavefront, meaning it's intensity distribution is equal everywhere on every point of the wavefront. For this we hook a CCD camera up to our computer which measures the intensity distribution. This image is then sent to our Labview program, which processes this image and turns it into a pattern for the DMD. The DMD or Digital Micromirror Device is a device that is made up of thousands of tiny mirrors, all of which can stand in either + 12 degrees or -12 degrees.
    We look at the profile and compare that to a profile as simulted by a Super Lorentzian function
    A Super Lorentzian function looks like this:
    A / (B + ( (X-C)/X0) ^n)) + D
    A/B is the top value
    C is the horizontal transliteration
    X0 is a value referring to the width of the function
    n is a power
    D is vertical transliteration
    For even numbers of n the function produces a top hat function. In our case, we want to simulate an eigth order Super Lorentzian, so n=8
    The image of the CCD Camera is a 12 bit image. Labview saves this as 16 bit, meaning it has 2^16 different grayscale values.
    I don't have the CCD camera yet so for now I use the webcam of my laptop and turn that into a 16-bit image.
    Here a some screenshots of my program so far:
    And a SL function looks like this:
    Our error inducement comes from an algorith developed by Dorrer and Zuegel, two german physicists.
    A screenshot of their paper concerning binary spatial light modulation:
    But the main issue I am concerned with is thus the error inducing. Doesn't normal array processing remove the possibility to do so? And if not, how can I do it?

  • Problem using Ago function

    Hi all,
    My problem is that when i use ago function it displays next months value for example first column shows balance of april month and next to it ago column displays balance of the may not march. I am really confused. Please help,
    AGO(SR02BriefIncome.sr02_cube.BALANCE, SR02BriefIncome.timesDim."times Detail", 1);

    Hi Nico,
    Another question in relation to Ago function; I need to get value/balance a year ago which is 12 months ago, and also previous year's last months balances; the problem is that Ago function takes only integer, I have tried to put a variable, Is there is way i can get balances of the previous year's last month because it will be much easier to get it using built-in ago function.
    Also i need help with your answer for thread How to use row values in Presentation or Administration for calculation
    Re: How to use row values in Presentation or Administration for calculation
    "Yes, I forgot this one. Of course, this solution work when you have a pivot column.
    If you talk about period to period comparison, really often I must do a share like this one : ($2-$5)/$5.
    And unfortunately, this is not possible in a calculated item. Is it ?"
    We have a lot of reports with inter-row calculations, we have already used a lot sql model but we would like use answer also. Can u explain it with exact examples or steps.
    thank you again,

  • Fcc for the below stcture

    hi i want fcc for this stcture at target side this is the mapping
    doc
         LTAP-VLPLA           Zone     RULE     first two characters of LTAP-VLPLA
         N/A           N/A     RULE     Set to blank
         LTAP-VLPLA          Carousel     RULE     third character of LTAP-VLPLA
         N/A          N/A     RULE     Set to blank
         LTAP-VLPLA          Row     RULE     fourth and fifth characters of LTAP-VLPLA
         N/A          N/A     RULE     Set to blank
         LTAP-VLPLA          Shelf     RULE     sixth and seventh characters of LTAP-VLPLA
         N/A          N/A     RULE     Set to blank
         LTAP-VLPLA          Bin     RULE     eigth and nineth characters of the LTAP-VLPLA
         N/A          N/A     RULE     Set to blank
         LTAP-MATNR          Item Number     DIRECT     
         N/A          N/A     RULE     Set to blank
         LTAP-VLPLA          Host Location     DIRECT     
         N/A          N/A     RULE     Set to blank
         MAKT-MAKTX          Description     DIRECT     In table MAKT where Matnr = LTAP-MATNR
         N/A          N/A     RULE     Set to blank
                    On Hand Qty     RULE     Set to 99999999
    and target stctue required which is given below how to write fcc for this stcture
    01 1 01 01 01                       CAA00101A                                                  
    01 1 01 01 02                       CAA00101B                                                  
    01 1 01 01 03                       CAA00101C                                                  
    01 1 01 01 04                       CAA00101D                                                  
    01 1 01 02 01                       CAA00102A                                                  
    01 1 01 02 02                       CAA00102B                                                  
    01 1 01 02 03                       CAA00102C                                                  
    01 1 01 02 04                       CAA00102D                                                  
    01 1 01 03 01  8002015              CAA00103A CLAMP, WOOD, 8IN, RBR BLKT                       
    01 1 01 03 02                       CAA00103B                                                  
    01 1 01 03 03                       CAA00103C                                                  
    01 1 01 03 04                       CAA00103D                                                  
    01 1 01 04 01                       CAA00104A                                                  
    01 1 01 04 02                       CAA00104B                                                  
    01 1 01 04 03                       CAA00104C                                                  
    01 1 01 04 04                       CAA00104D                                                  
    01 1 01 05 01  8025009              CAA00105A BATTERY, ALK, HD, AA, 1.5 VOLT

    IS ur 01 1 01 03 01 8002015 CAA00103A CLAMP, WOOD, 8IN, RBR BLKT  record is different than
    01 1 01 03 03 CAA00103C
    I mean do you have different structure for above tow records?
    U can refer blogs on SDN for FCC conf
    to start -refer below ones.
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

  • Replace n strings

    hello,
    i have a string that contain some words that i want to replace to other words.
    replace can do just one and i want in onw sql to replace n strings.
    for example:
    i have the string:
    "this is a test string and i want to replace several words"
    i want to replace the words: test with aaa,want with bbb,several with ccc.
    so after it will be:
    "this is a aaa string and i bbb to replace ccc words"
    how can i do it in one sql or what is the best way to do it ?
    thanks
    Zvika

    You can try to do this with using of MODEL clause.
    SELECT cur_val
    FROM (SELECT 1 AS dim_col, 'this is a test string and i want to replace several words' AS cur_val FROM dual)
    MODEL
    DIMENSION BY (dim_col)
    MEASURES (cur_val, 1 string_to_replace_num)
    UNIQUE DIMENSION
    RULES ITERATE (3)
    cur_val[1] = replace(cur_val[1],
    case string_to_replace_num[1] when 1 then 'test' when 2 then 'want' when 3 then 'several' end,
    case string_to_replace_num[1] when 1 then 'aaa' when 2 then 'bbb' when 3 then 'ccc' end
    string_to_replace_num[1] = string_to_replace_num[1] + 1
    In the row RULES ITERATE (3) - 3 is not a magic number. It is equal to total number of strings have to be replaced.

  • OBIEE Answers and filtered totals

    We try to prepare an reports in OBIEE Answers and we want to take filtered totals of a field.
    Let me clear
    We have a field values as
    FieldSampleTotal VAlues
    Name1                           1000
    Nema1 Detail 1 20
    NAme1 Detail 2 980
    NAme2                           2000
    Because of some hieararchy is data we want to calculated sum of just bold lines.
    it means total is 3000
    Thansks a lot.

    An other option for inter-rows calculation will be to use the filter in one column formula of a table view :
    FILTER(Fact.Values USING (Dim.Colunm = 'Name1' or Dim.Colunm = 'Name2'))I don't see the layout of your final report.
    Do you want to see the details rows ?

  • Using muliple delimiters when importing files.

    I have some sql*loader control files that I created manually, but I would like to set those up in OWB so that I can keep the entire ETL process in one tool.
    My files are Tab delimited, but the last field has trailing spaces so in my Control file I have TERMINATED BY WHITESPACE on the last field. How do I do this with OWB?
    Thanks,
    Scott

    Hi
    I personally have not found that much difference between sqlload and external tables in mappings without complex joins
    What I think you are doing
    sqlload --> Staging Table --> Validated staging table --> Fact Table
    What I normally do for loads under 1m rows (rule of thumb based on current hardware that I don't stick to)
    External Table --> Validated staging table --> Fact Table
    which includes all the lookups in the first step
    What I normally do for loads over 1m rows
    External Table --> Staging Table --> Validated staging table --> Fact Table
    where the lookups are done in the second step and the staging table can be indexed or not. The staging table is nologging and the first step a truncate/insert.
    What I was suggesting is that you might consider switching from
    sqlload --> Staging Table --> Validated staging table --> Fact Table
    to using
    External Table --> Staging Table --> Validated staging table --> Fact Table
    where the first step is a straight truncate/insert with no joins.
    Cheers
    Ian

  • If you are interested to know, cumulatives for multiplication

    select x, sum(x) over ( partition by 1 order by rownum ) sumcume ,
    round(power( 2, ( sum(log(2,x)) over ( partition by 1 order by rownum ) ) ), 0) multiplyCume
    from
    select 2 x from dual
    union all
    select 3 x from dual
    union all
    select 2 x from dual
    union all
    select 5 x from dual
    --Samson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can do it more simply like this:
    ESL function, EXP (SUM (LN (x))) is used in inter-row multiplications.
    SELECT x
         , SUM (x) OVER (ORDER BY ROWNUM) sumcume
         , EXP (SUM (LN (x)) OVER (ORDER BY ROWNUM)) multiplycume
      FROM (SELECT 2 x
              FROM DUAL
            UNION ALL
            SELECT 3 x
              FROM DUAL
            UNION ALL
            SELECT 2 x
              FROM DUAL
            UNION ALL
            SELECT 5 x
              FROM DUAL)Query Your Dream & Future at SoQooL
    http://www.soqool.com

  • Now how to create a tsql to get best result.

    Hi all
    I have a table that called   voucheritem
    This table has 6 fields
    And my standard value is:
    Rows
    Rules
    Subsidiary
    1ad
    2ad
    3ad
    4ad
    5ad
    1
    Rule 1
    2050  
    103
    207
    396
    452
    509
    2
    Rule 2
    2050
    107
    210
    354
    431
    580
    Row 1 : I want to compare rule1 and the table values (voucheritem), when the values are opposite of each other then show the values
    Row2 : I want to compare rule2 and the table values (voucheritem), when the values are opposite of each other then show the values
    I run this code:
    Select * from
    voucheritem
    Result is
    Rows
    Subsidiary
    1ad
    2ad
    3ad
    4ad
    5ad
    1
    2050  
    103
    208
    396
    452
    509
    2
    2050
    107
    210
    354
    435
    580
    3
    2050
    110
    210
    300
    430
    590
    4
    2050
    100
    207
    396
    452
    510
    5
    2050
    107
    210
    360
    431
    580
    6
    2050
    103
    207
    396
    452
    509
    7
    2050
    107
    210
    354
    431
    580
    see row 1 :
    2ad has 208 value its not equal by rule 1
    row 2: 4ad has  435 value . its not equal by rule 2
     Now how to create a tsql to  get best result.
    Name of Allah, Most Gracious, Most Merciful and He created the human

    Does this do what you were looking for?
    DECLARE @rules TABLE (ruleID INT, subsidiary INT, ad1 INT, ad2 INT, ad3 INT, ad4 INT, ad5 INT)
    INSERT INTO @rules (ruleID, subsidiary, ad1, ad2, ad3, ad4, ad5)
    values
    (1,2050,103,207,396,452,509),
    (2,2050,107,210,354,431,580)
    DECLARE @voucheritem TABLE (voucherID INT, subsidiary INT, ad1 INT, ad2 INT, ad3 INT, ad4 INT, ad5 INT)
    INSERT INTO @voucheritem (voucherID, subsidiary, ad1, ad2, ad3, ad4, ad5)
    values
    (1, 2050, 103, 208, 396, 452, 509),
    (2, 2050, 107, 210, 354, 435, 580),
    (3, 2050, 110, 210, 300, 430, 590),
    (4, 2050, 100, 207, 396, 452, 510),
    (5, 2050, 107, 210, 360, 431, 580),
    (6, 2050, 103, 207, 396, 452, 509),
    (7, 2050, 107, 210, 354, 431, 580)
    SELECT v.*,
    CASE WHEN v.ad1 NOT IN (SELECT ad1 FROM @rules) THEN 'E' ELSE NULL END AS ad1Error,
    CASE WHEN v.ad2 NOT IN (SELECT ad2 FROM @rules) THEN 'E' ELSE NULL END AS ad2Error,
    CASE WHEN v.ad3 NOT IN (SELECT ad3 FROM @rules) THEN 'E' ELSE NULL END AS ad3Error,
    CASE WHEN v.ad4 NOT IN (SELECT ad4 FROM @rules) THEN 'E' ELSE NULL END AS ad4Error,
    CASE WHEN v.ad5 NOT IN (SELECT ad5 FROM @rules) THEN 'E' ELSE NULL END AS ad5Error
    FROM @voucheritem v
    LEFT OUTER JOIN @rules r
    ON v.ad1 = r.ad1
    AND v.ad2 = r.ad2
    AND v.ad3 = r.ad3
    AND v.ad4 = r.ad4
    AND v.ad5 = r.ad5
    WHERE r.ruleID IS null

  • Members on rows, can they be passed to run-time prompt in a business rule?

    Hi!
    I have a input form which has a business rule with properties "Run on Save" and "Use members on Form".
    The business rule has run-time prompts (local variables) as follows (showing only the fix part of br...)
    FIX ([V_Year],[V_Version],[V_Scenario],@LEVMBRS ("Offering", 0),[V_Entity],
    [V_ICP], [V_Account])
    calculation...
    endfix
    Now my accounts are on rows and I would like pass those account members to the [V_Account] variable through run time prompt. The [V_Account] ís a local variable with Type "Members" in Account dimension. I have also selected 0-level accounts as limits. Other dimension members from page/pov seem be passed successfully to run-time-prompts.
    The run-time-prompt does not seem to be able to catch those account members on rows? Is it at all possible to pass members on dataform rows to run time prompts?
    kind regards,
    user637777

    Hi!
    Thanks John!
    I just have live with that and find another way to restrict the calculation regarding those accounts.
    kind regards,
    user637777

  • Deleting  rows with missing values in field in start routine of update rule

    Hello experts,
    how can I delet rows with missing values in a specific field in the start routine of update rules?
    I think ABAP code should look something like this:
    delete ...  from DATA_PACKAGE where Z_NO = ''.
    thanks in advance for any suggestions!
    hiza

    Write:
    delete data_package where field = value.
    Hope it helps.
    Regards

Maybe you are looking for

  • Cant add files to library without itunes crashing

    I removed all the tracks from my itunes library to readd them (adding new things was getting confusing) Now whenever i try to add the files to itunes the programme freezes and I have to force quit. I have 250gb of music to add and doing this a file a

  • Has anyone tried iUsers for sharing an iPad?

    Trying to figure out the best way for my wife and I to share an iPad.  There is a free download called iUsers that seems to have the right functionality, but the user reviews are from mid-2011 when it was still in Beta. Has anyone tried this more rec

  • Deleting Equipment Usage List - Table EQUZ, Field DATAB

    Hi Gurus, An equipment was inadvertently uninstalled from a location and then resinstalled again. This resulted in a new Valaidity Date being created. We have a third part tool, that uses the Validity From date for its calculation. It seems unlikely

  • Problems upgrading to IOS 4.2

    iTunes tells me there are software updates for my iPhone, but every time i hit the update button to get iOS 4.2, iTunes gives me a message that "the current iTunes software is up to date" and won't allow me to update my iPhone. Anyone else experienci

  • How do I restore the default folder structure in my iPhone internal storage?

    The music folder is missing from the internal storage folder so I can't sync anything to my iphone 4. I do have a small amount of music on my phone though? I can't see where that is stored however. How do i rectify this?