Complex, nested IF formula, with AND

Hi folks,
I'm setting up a spreadsheet for me to estimate how long it might take for me to complete a race in an online f1 simulator. One formula is giving me trouble, and I'm sure I'm going about it the wrong way.
Basically, there's 2 variables I'm looking for. One variable can either be "Softs", or "Hards", the other can be an interger between 0 and 39, but I really only care if it's 0 or not 0.
Depending on the combination of these 2 variables, I want the formula to perform a specific calculation.
Here's what I've been trying to use:
=IF(AND($H28="Softs",$I28<1),$E$5+(($E28-1)*$H$23),IF(AND($H28="Softs",$I28>0),$ E$5+(($E28-2)*$H$23)+$E$4,IF(AND($H28="Hards",$I28<1),$E$5+(($E28-1)*$I$23,IF(AN D($H28="Hards",$I28>0),$E$5+(($E28-2)*$I$23)+$E$4)))))
So:
IF H28="Softs" AND I28<1, then calculate $E$5+(($E28-1)*$H$23
IF H28="Softs" AND I28>0 then calculate $E$5+(($E28-2)*$H$23)+$E$4
IF H28="Hards" AND I28<1 then calculate $E$5+(($E28-1)*$I$23
IF H28="Hards" AND I28>0 then calculate $E$5+(($E28-2)*$I$23)+$E$4
It's the bits in bold that are giving me trouble. If the variables are "Hard" and <1, I get a syntax error, if they are "Hard" and >1, then it just returns "FALSE".
Could anyone give me any clues?
Many thanks,
Chris

Hi Chris,
Assuming that your description of the desired calculations is accurate:
So:
IF H28="Softs" AND I28<1, then calculate $E$5+(($E28-1)*$H$23
IF H28="Softs" AND I28>0 then calculate $E$5+(($E28-2)*$H$23)+$E$4
IF H28="Hards" AND I28<1 then calculate $E$5+(($E28-1)*$I$23
IF H28="Hards" AND I28>0 then calculate $E$5+(($E28-2)*$I$23)+$E$4
This should give you the same results:
=$E$5+($E28-IF(I28<1,1,2))*IF(H28="Softs",$H$23,$I$24)+IF(I28<1,0,$E$4)
     A   +(    B     -      C      )             *             D              +                 E
Here's the analysis:
Your basic expression is:
= A + (B - C) * D + E
A and B are the same in all four possible cases:
A = $E$5, B = $E28
C and E depend on the value of I28. I28 has only two significant values: <1 or NOT < 1.
IF I28 < 1 then C = 1 and E = 0
IF I28 is NOT < 1, then C = 2 and E = $E$4
D depends on the value of H28. H28 may have either of two values: "Softs" or "Hards" ("NOT Softs):
If H28 = "Softs", then D = $H$23.
IF H28 ≠ "Softs", then D = $I$23
String together the bits to form the expression above.
Regards,
Barry

Similar Messages

  • Complex formula with multi-searches

    Hello
    I wonder if it is possible with NUMBERS to do some formula with several filterings.
    Example of table :
    ~ A | B | _* C*_
    1 | 1 | 0 | val1
    2 | 1 | 1 | val2
    3 | 1 | 2 | val3
    4 | 2 | 1 | val4
    5 | 2 | 2 | val5
    I would like to find, thanks to a formula, the value in column C when value in column A is (for example 1) AND value in column B is 2. In this case, the answer should be val3
    I know how to do it thanks to the SEARCH (? - RECHERCHE in the french version of Numbers) when I only have to search on one column and the solution is unique. But I wonder how to do it when the search has to do a matching between several columns (or ranks).
    Does anybody know how to do that ?
    In the french version of NUMBERS, in the Help, there is a page telling how to combine logical functions and searches but the documentation does not seem to be finished. The text just says "We are going to show examples of more complex combinations" but there are no examples ...
    Best regards
    Alef
    Message was edited by: AlefThau

    Je ne vois pas à quelle page de l'aide vous faites référence.
    Pour ma part, dans l'aide je peux lire:
    Dans le navigateur de fonctions je peux lire:
    informations reprises du "Guide de l'utilisateur des formules et fonctions d'iWork" auquel tout utilisateur peut avoir accès via le menu d'Aide.
    Pour complément d'information, je vous signale que depuis mon idisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    vous pouvez télécharger:
    For_iWork:iWork '09:functionsNames.numbers.zip
    qui vous évitera des erreurs de traduction des noms de fonctions.
    Yvan KOENIG (VALLAURIS, France) dimanche 13 septembre 2009 15:33:58

  • Search and replace formulas with AppleScript

    Thanks to this forum I've found out that it is possible to search and replace text by other text or formulas with AppleScript in Numbers 3.2
    Does anybody have a script to search and replace a formula or a part of a formula by another formula or a partial formula.
    For example:
    I would like to be able to find:
    = Table1::$b$3
    and replace this by:
    = Table1::$b$4

    De Signature,
    Would this approach work for you...
    This is a very neat way edit a complex formula in a single cell....
    a) Copy and Paste the formula to a new black page in Pages,
    b) Do your Find and Replace, then
    c) Copy and Paste the formulae back into the cell in Numbers.
    It works like a charm.
    Here is an example of how I used this approach...
    Original cell formulae:
    =AVERAGE(
    SMALL(OFFSET(K3,1,0,20,1),1),SMALL(OFFSET(K3,1,0,20,1),2),
    SMALL(OFFSET(K3,1,0,20,1),3),SMALL(OFFSET(K3,1,0,20,1),4),
    SMALL(OFFSET(K3,1,0,20,1),5),SMALL(OFFSET(K3,1,0,20,1),6),
    SMALL(OFFSET(K3,1,0,20,1),7),SMALL(OFFSET(K3,1,0,20,1),8))
    Final version of formulae:
    =AVERAGE(
    SMALL(OFFSET(K3,N1,0,20,1),1),SMALL(OFFSET(K3,N1,0,20,1),2),
    SMALL(OFFSET(K3,N1,0,20,1),3),SMALL(OFFSET(K3,N1,0,20,1),4),
    SMALL(OFFSET(K3,N1,0,20,1),5),SMALL(OFFSET(K3,N1,0,20,1),6),
    SMALL(OFFSET(K3,N1,0,20,1),7),SMALL(OFFSET(K3,N1,0,20,1),8))
    Find Replace: be cautious with the Find, to ensure it is unique, in my this example ",1,", to avoid changing the" ,1)"
    Enjoy...

  • Formulas, superscripts and subscripts with Pages on iPad?

    How to write formulas, superscripts and subscripts with Pages on my iPad? Do i need a third part app? If so, could anyone suggest one?
    Thank you!

    I've found a possible solution to insert equations and formulas without Latex or copy/paste images, only with Pages for iPad and without internet, using Pages tools. So, I have some examples of Pages documents. If you want to take a look them, give me your email and I'll send you an example.

  • Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please.

    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!

    Grum12 wrote:
    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!
    Hi Grum,
    If the formulas aren't filling to the new column, you must have changed something in the template since you first opened it. Numbers is rather fussy about filling row content in columns as they are added. Only rows with the same expression in every Body Column will fill when a column is added. Just as an experiment, start a new Employee Schedule document from the Template Chooser and then add a column by clicking the Add Column handle in the upper right corner of the table. If that works, as it should, then think about what might have changed in your working document to disconnect that feature. Maybe we can figure it out together.
    Jerry

  • Replace last delimeter with "and" in a string in SSRS

    Hi,
    I want to replace last delimeter (comma) with and 
    in a string in SSRS 2008 R2.
    if there are more than one unit, and the Area of the units are different, then the area of each must must be listed separated by commas and ‘and’ before the last one.
    i.e.,
    Input string- Hi,Hello,HRU,
    Desired output- Hi,Hello and 
    HRU..
    how can I achieve this (and
    before last word) ?
    (suggest in SSRS or even in SQL)
    Rgds/-

    Your example seems to indicate you wish to substitute "and" for the second to last delimiter and ".." for the last. Is that the ask? Will there actually be a trailing delimiter on the input string?
    This can be done several ways: In the dataset, in an expression, using custom code.
    The approach for the dataset and expression are similar, just the language is different. Dataset will usually deliver better performance since the source is often a more powerful server (in the case of a SQL dataset).
    In an SSRS expression it might look like this:
    =Left(Fields!InputString.Value,InStrRev(Fields!InputString.Value,",")-1)+" and "+Right(Fields!InputString.Value,Len(Fields!InputString.Value)-InStrRev(Fields!InputString.Value,","))
    This assumes the input string is actually a field from your dataset but it could be anything. The Left piece gets the string that occurs before the last comma without the comma, then append " and ", then the Right expression gets everything after the last
    comma and appends it. If you will have a trailing delimiter, you could substitute the following formula anywhere you see Fields!InputString.Value:
    =Replace(Trim(Replace(Fields!InputString.Value,","," "))," ",",")
    Because Trim in an SSRS expression only trims leading and trailing spaces, the delimiters must be converted to a space. So this only works if there are no spaces in the original string. If the input is "Hi,Hello,How are you," the result of this formula will
    be "Hi,Hello,How,are,you" because the spaces between How, are and you will get replaced by ",". To handle embedded spaces makes the expression more complex. Assuming the input string is "Hi,Hello,How are you,":
    =Replace(Replace(Trim(Replace(Replace(Fields!InputString.Value," ","|"),","," "))," ",","),"|"," ")
    This expression uses 2 more replace statements. The innermost statement substitues "|" for the embedded spaces so they don't get replace with ",". You should use a character that you are sure will not appear in the string otherwise. Or use a sequence of
    characters like "|^|" that you are sure won't appear if any one character may possibly appear. The outermost Replace restores the "|" characters back to spaces.
    A code solution may be easier. Just wrap the below in a simple function:
    return str.Trim(",".ToCharArray()).Substring(0, str.Trim(",".ToCharArray()).LastIndexOf(",") - 1) + " and " + str.Trim(",".ToCharArray()).Substring(str.Trim(",".ToCharArray()).LastIndexOf(",") + 1);
    This is the VB.Net equivalent of the expressions above.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • COMPLEX PARTITIONING between an EXCEL and a DATABASE (Datasource)

    I want to make a complex partitioning between an excel and a Database.
    *In the Excel File :
    - I have the Data summarized at Month Level,
    -Time sales is between 1993 UNTIL 1996.
    *In the Database:
    -I have my DB Source at Day Level .
    -Time sales is between 1993 until NOW.
    In the BMM:
    -In my Database's SALES LOGICAL TABLE SOURCE Content:
    I put in WHERE SECTION :
    " CAST ( EXTRACT( YEAR FROM TRANSACCIONAL."".OLTP.ORDER_HEADER.ORDERED_DATE) AS INTEGER ) > 1996"
    To constraint the data from 1996 until NOW.
    -And I specify at the level content:
    To SALES LOGICAL TABLE SOURCE EXCEL FILE: MONTH DAY LEVEL
    To SALES LOGICAL TABLE SOURCE DB : DAY LEVEL
    I want to make a COMPLEX PARTITIONING(Value-Based and Level-Based).
    When I try to make the query:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14023] None of the fact sources for Times.Calendar_year_cal_year_code are compatible with the detail filter []. (HY000)
    SQL Issued: SELECT Times.Calendar_year_cal_year_code saw_0, Sales.Amount_sold saw_1 FROM "Sales BI DataMart" ORDER BY saw_0
    Can any1 help me?
    Thanks in advance..

    Hi,
    Actually value based partitioning works fine on the data sources which are stored on RDBMS. I haven't try it with a excel source. There is a detailed description in the link below.
    http://108obiee.blogspot.com/2009/01/fragmentation-in-obiee.html
    Hope this helps,
    Cheers.
    Cuneyt

  • Can we restrict a formula with other characteristics?

    Hello all,
    I am using a structure in rows in my query designer. I have a formula in that structure now I a want to restrict that formula with particular fund ranges.
    Also one option that I am thinking is can I create the same formula in the key figures section ( but the formula has characteristics in it and i tried but it does not let me) has anyone done that.
    Can we do any of that or is there any other way of doing it.
    Thanks in advance,
    Raj

    Bhanu, Stefen,
    This what my query looks like ...i have a KYF structure in cloumns which has 4-5 restricted key figures.
    Then i have manually created a new structure in rows, because the client requirement is very very specific, most of the lines in my rows structure are like nodes of hierarchy and sometimes that node is restricted more by some char. now when i get at the bottom 5 lines i need to create a formula (revnuesexpensetrasnfers) and restrict that by fund ranges. and this object should be added to another selection (hierarchy node) which evetually will get what client wants.
    So how can I do it can you tell
    Thanks,Raj

  • Unable to attach formula with Element

    Hi All,
    I have written a formula with type Oracle Payroll that is 10% based on Basic pay and return a value in a variable,after writing I am unable to associate it with element , If I take the type element input validation it appears in the input value screen in the element window but when I take type Oracle payroll it does not appear ,kindly share your experiences
    Regards,

    Hi,
    A Oracle Payroll type Fast Formula can be attached to an Element using "Formula Results" window.
    Navigation : Total Compensation > Basic > Formula Results
    1. Select the Element to which you want to attach this Formula and click Find.
    2. In Processing Rules block, Select Name as "Standard" and then attach your formula in the "Formula" field.
    3. In Formula Results block, Select Name as the Return Variable you are returing in the Formula and then select "direct result" as Type.
    4. Select the input value of your element to which you want to pass this value.
    5. If you want to pass this value to another element. Then select "Indirect result" as Type, select that element and then select the input value of that element to
    which this variable value needs to be passed.
    6. To pass a value using Indirect result, the destination element should be non-recurring and with lesses priority (higher number).
    Hope this helps you.
    - Sri.
    Edited by: Sri81 on Nov 26, 2008 1:15 AM

  • In iWork 09, Numbers, how do I replace a formula with calculated results for a whole column?

    I have a rather large Numbers spreadsheet.  I have used a formula to create a new column of information.  I now want to replace the formula with the actual results calculated by that formula for each cell in that column, so that I can delete some of the other columns.  How do I do that?

    Copy the cells with the results, then select the destination cell, and use the menu item "Edit > Paste Values".
    You may want to paste to a different location in case you need the source data or formulas in the future.
    Regards,
    Wayne

  • Query rewrites with Nested materialized views with different aggregations

    Platform used : Oracle 11g.
    Here is a simple fact table (with measures m1,m2) and dimensions (a) Location (b) Calendar and (c) Product. The business problem is that aggregation operator for measure m1,m2 are different along location dimension and Calendar dimension. The intention is to preaggregate the measures for a product along the calendar dimension and Location dimension and store it as materialized views.
    The direct option is to define a materialized view with Inline queries (Because of the different aggrergation operator, it is not possible to write a query without Inline query). http://download-uk.oracle.com/docs/cd/B28359_01/server.111/b28313/qradv.htm#BABEAJBF documents the limitations that it works only for 'Text match' and 'Equivalent queries' and that is too limiting.
    So decided to have nested materialized view, with first view having just joins(my_dim_mvw_joins), the second view having aggregations along Calendar dimension (my_dim_mvw_calendar) and third view having aggregations along the Location dimension(my_dim_mvw_location). Obviously I do not want the query I fire to know about materialized views and I fire it against the fact table. I see that for the fired query (Which needs aggregations along both Calendar and Location), is rewritten with just second materialized view but not the third. (Had set QUERY_REWRITE_INTEGRITY as TRUSTED) .
    Wanted to know whether there are limitations on Query Writes with nested materialized views? Thanks
    (Have given a simple testable example below. Pls ignore the values given in 'CALENDAR_IDs', 'PRODUCT_IDs' etc as they are the same for all the queries)
    -- Calendar hierarchy table
    CREATE TABLE CALENDAR_HIERARCHY_TREE
    (     "CALENDAR_ID" NUMBER(5,0) NOT NULL ENABLE,
    "HIERARCHY1_ID" NUMBER(5,0),
    "HIERARCHY2_ID" NUMBER(5,0),
    "HIERARCHY3_ID" NUMBER(5,0),
    "HIERARCHY4_ID" NUMBER(5,0),
    CONSTRAINT "CALENDAR_HIERARCHY_TREE_PK" PRIMARY KEY ("CALENDAR_ID")
    -- Location hierarchy table
    CREATE TABLE LOCATION_HIERARCHY_TREE
    (     "LOCATION_ID" NUMBER(3,0) NOT NULL ENABLE,
    "HIERARCHY1_ID" NUMBER(3,0),
    "HIERARCHY2_ID" NUMBER(3,0),
    "HIERARCHY3_ID" NUMBER(3,0),
    "HIERARCHY4_ID" NUMBER(3,0),
    CONSTRAINT "LOCATION_HIERARCHY_TREE_PK" PRIMARY KEY ("LOCATION_ID")
    -- Product hierarchy table
    CREATE TABLE PRODUCT_HIERARCHY_TREE
    (     "PRODUCT_ID" NUMBER(3,0) NOT NULL ENABLE,
         "HIERARCHY1_ID" NUMBER(3,0),
         "HIERARCHY2_ID" NUMBER(3,0),
         "HIERARCHY3_ID" NUMBER(3,0),
         "HIERARCHY4_ID" NUMBER(3,0),
         "HIERARCHY5_ID" NUMBER(3,0),
         "HIERARCHY6_ID" NUMBER(3,0),
         CONSTRAINT "PRODUCT_HIERARCHY_TREE_PK" PRIMARY KEY ("PRODUCT_ID")
    -- Fact table
    CREATE TABLE RETAILER_SALES_TBL
    (     "PRODUCT_ID" NUMBER,
    "PRODUCT_KEY" VARCHAR2(50 BYTE),
    "PLAN_ID" NUMBER,
    "PLAN_PERIOD_ID" NUMBER,
    "PERIOD_ID" NUMBER(5,0),
    "M1" NUMBER,
    "M2" NUMBER,
    "M3" NUMBER,
    "M4" NUMBER,
    "M5" NUMBER,
    "M6" NUMBER,
    "M7" NUMBER,
    "M8" NUMBER,
    "LOCATION_ID" NUMBER(3,0),
    "M9" NUMBER,
    CONSTRAINT "RETAILER_SALES_TBL_LOCATI_FK1" FOREIGN KEY ("LOCATION_ID")
    REFERENCES LOCATION_HIERARCHY_TREE ("LOCATION_ID") ENABLE,
    CONSTRAINT "RETAILER_SALES_TBL_PRODUC_FK1" FOREIGN KEY ("PRODUCT_ID")
    REFERENCES PRODUCT_HIERARCHY_TREE ("PRODUCT_ID") ENABLE,
    CONSTRAINT "RETAILER_SALES_TBL_CALEND_FK1" FOREIGN KEY ("PERIOD_ID")
    REFERENCES CALENDAR_HIERARCHY_TREE ("CALENDAR_ID") ENABLE
    -- Location dimension definition to promote query rewrite
    create DIMENSION LOCATION_DIM
    LEVEL CHAIN IS LOCATION_HIERARCHY_TREE.HIERARCHY1_ID
    LEVEL CONSUMER_SEGMENT IS LOCATION_HIERARCHY_TREE.HIERARCHY3_ID
    LEVEL STORE IS LOCATION_HIERARCHY_TREE.LOCATION_ID
    LEVEL TRADING_AREA IS LOCATION_HIERARCHY_TREE.HIERARCHY2_ID
    HIERARCHY PROD_ROLLUP (
    STORE CHILD OF
    CONSUMER_SEGMENT CHILD OF
    TRADING_AREA CHILD OF
    CHAIN
    -- Calendar dimension definition
    create DIMENSION CALENDAR_DIM
    LEVEL MONTH IS CALENDAR_HIERARCHY_TREE.HIERARCHY3_ID
    LEVEL QUARTER IS CALENDAR_HIERARCHY_TREE.HIERARCHY2_ID
    LEVEL WEEK IS CALENDAR_HIERARCHY_TREE.CALENDAR_ID
    LEVEL YEAR IS CALENDAR_HIERARCHY_TREE.HIERARCHY1_ID
    HIERARCHY CALENDAR_ROLLUP (
    WEEK CHILD OF
    MONTH CHILD OF
    QUARTER CHILD OF
    YEAR
    -- Materialized view with just joins needed for other views
    CREATE MATERIALIZED VIEW my_dim_mvw_joins build immediate refresh complete enable query rewrite as
    select product_id, lht.HIERARCHY1_ID, lht.HIERARCHY2_ID, lht.HIERARCHY3_ID, lht.location_id, cht.HIERARCHY1_ID year,
    cht.HIERARCHY2_ID quarter, cht.HIERARCHY3_ID month, cht.calendar_id week, m1, m3, m7, m9
    from retailer_sales_tbl RS, calendar_hierarchy_tree cht, location_hierarchy_tree lht
    WHERE RS.period_id = cht.CALENDAR_ID
    and RS.location_id = lht.location_id
    and cht.CALENDAR_ID in (10,236,237,238,239,608,609,610,611,612,613,614,615,616,617,618,619,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477)
    AND product_id IN (5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20)
    AND lht.location_id IN (2, 3, 11, 12, 13, 14, 15, 4, 16, 17, 18, 19, 20)
    -- Materialized view which aggregate along calendar dimension
    CREATE MATERIALIZED VIEW my_dim_mvw_calendar build immediate refresh complete enable query rewrite as
    select product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID ,location_id, year, quarter, month, week,
    sum(m1) m1_total, sum(m3) m3_total, sum(m7) m7_total, sum(m9) m9_total,
    GROUPING_ID(product_id, location_id, year, quarter, month, week) dim_mvw_gid
    from my_dim_mvw_joins
    GROUP BY product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID , location_id,
    rollup (year, quarter, month, week);
    -- Materialized view which aggregate along Location dimension
    CREATE MATERIALIZED VIEW my_dim_mvw_location build immediate refresh complete enable query rewrite as
    select product_id, year, quarter, month, week, HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id,
    sum(m1_total) m1_total_1, sum(m3_total) m3_total_1, sum(m7_total) m7_total_1, sum(m9_total) m9_total_1,
    GROUPING_ID(product_id, HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id, year, quarter, month, week) dim_mvw_gid
    from my_dim_mvw_calendar
    GROUP BY product_id, year, quarter, month, week,
    rollup (HIERARCHY1_ID, HIERARCHY2_ID, HIERARCHY3_ID, location_id)
    -- SQL Query Fired (for simplicity have used SUM as aggregation operator for both, but they will be different)
    select product_id, year, HIERARCHY1_ID, HIERARCHY2_ID,
    sum(m1_total) m1_total_1, sum(m3_total) m3_total_1, sum(m7_total) m7_total_1, sum(m9_total) m9_total_1
    from
    select product_id, HIERARCHY1_ID , HIERARCHY2_ID , year,
    sum(m1) m1_total, sum(m3) m3_total, sum(m7) m7_total, sum(m9) m9_total
    from
    select product_id, lht.HIERARCHY1_ID , lht.HIERARCHY2_ID , lht.HIERARCHY3_ID ,lht.location_id, cht.HIERARCHY1_ID year, cht.HIERARCHY2_ID quarter, cht.HIERARCHY3_ID month, cht.calendar_id week,m1,m3,m7,m9
    from
    retailer_sales_tbl RS, calendar_hierarchy_tree cht, location_hierarchy_tree lht
    WHERE RS.period_id = cht.CALENDAR_ID
    and RS.location_id = lht.location_id
    and cht.CALENDAR_ID in (10,236,237,238,239,608,609,610,611,612,613,614,615,616,617,618,619,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477)
    AND product_id IN (5, 6, 7, 8, 11, 12, 13, 14, 17, 18, 19, 20)
    AND lht.location_id IN (2, 3, 11, 12, 13, 14, 15, 4, 16, 17, 18, 19, 20)
    GROUP BY product_id, HIERARCHY1_ID , HIERARCHY2_ID , HIERARCHY3_ID , location_id, year
    ) sales_time
    GROUP BY product_id, year,HIERARCHY1_ID, HIERARCHY2_ID
    This Query rewrites only with my_dim_mvw_calendar. (as saw in Query Plan and EXPLAIN_MVIEW). But we would like it to use my_dim_mvw_location as that has aggregations for both dimensions.

    blackhole001 wrote:
    Hi all,
    I'm trying to make my programmer's life easier by creating a database view for them to query the data, so they don't have to worry about joining tables. This sounds like a pretty horrible idea. I say this because you will eventually end up with programmers that know nothing about your data model and how to properly interact with it.
    Additionally, what you will get is a developer that takes one of your views and see's that of the 20 columns in it, it has 4 that he needs. If all those 4 columns comes from a simple 2 table join, but the view has 8 tables, you're wasting a tonne of resources by using the view (and heaven forbid they have to join that view to another view to get 4 of the 20 columns from that other view as well).
    Ideally you'd write stored routines that satisfy exactly what is required (if you are the database resource and these other programmers are java, .net, etc... based) and the front end developers would call those routines customized for an exact purpose.
    Creating views is not bad, but it's by no means a proper solution to having developers not learn or understand SQL and/or the data model.

  • Physical inventory with and without handling unit managment

    Hello all,
    I would like to know what is the difference between physical inventory with and without handling unit management.
    Pl. advise.
    Thanks,
    Maxx

    Assuming you are referring to WM inventory, it is very similar.  Inventory is conducted at the SU level in WM if you are HU managed.  One of the most widely known issues is the lack of ability to post differences of nested HUs at the WM level.  If you are not using nested HUs, the process is the same as storage unit management without handling unit management.

  • Error in Formular with AND

    Hello All
    I have s simple Formula, which should split up values according to percenatges. This should only be done, if both fields are not zero. It seems to me, there is a problem with AND, as the routine works fine, if for example the percentages are 40% and 60%. But it does not work, if they are 100% and 0% or 0% and 100%. But why? It would understand it, if I would use OR but with and AND?
    Thanks and best regards
    Clemens
    IF {ZK_PERC,#,SORG,A} <> 0  AND {ZK_PERC,#,SORG,B}  <> 0.
    VALUE= {ZK_SALES, CUR,SORG,#} + {ZK_SALES, CUR,SORG,B} + {ZK_SALES, CUR,SORG,A}.
    { ZK_SALES, CUR,SORG,B} = VALUE * { ZK_PERC, # ,SORG,B} /100.
    { ZK_SALES, CUR,SORG,A} = VALUE* { ZK_PERC, # ,SORG,A} /100.
         {ZK_SALES,CUR,SORG, #} = 0.
    ELSE.
    ENDIF.

    Hello
    I guess that it is not working, because no data is writen into the cube when
    {ZK_PERC,#,SORG,A} = 100 and {ZK_PERC,#,SORG,B} = 0
    or the other way round. Whereas Data is writen into the cube, if for example
    {ZK_PERC,#,SORG,A} = 30 and {ZK_PERC,#,SORG,B} = 70
    I want the function to work if both {ZK_PERC,#,SORG,A} and {ZK_PERC,#,SORG,B} are not equal to zero.
    The function works, if I tripple the if statement. The code now looks like this:
    IF {ZK_PERC,#,SORG,A} "not equal" 0 AND {ZK_PERC,#,SORG,B} "not equal" 0.
    IF {ZK_PERC,#,SORG,A} = 0 AND {ZK_PERC,#,SORG,B} = 100.
    IF {ZK_PERC,#,SORG,A} = 100 AND {ZK_PERC,#,SORG,B} = 0.
    But i doupt that this can be the only solution as it is not really clear and the second and third if statement are allready cuvered with the first if statement.
    Thanks
    Clemens

  • The query contains a formula with the operator SUMCT

    I m trying to get query ready for Webi, getting the error as 'The query contains a formula with the operator %RT. Therefore, the query cannot be released for OLE DB for OLAP'
    I have not used any kind of s %GT, %RT, %CT, SUMGT, SUMRT, SUMCT and LEAF, also i have suppressed results / over results from the query, over to it, i have removed the calculate results as 'summation' feature and set to 'not defined' for all of my key figures.
    Still getting the error...
    Please suggest.
    Niraj

    hi,
    Ensure that all Link IDs are visible in the lsdal.ini file  located in the \Windows\system directory of the PAS Server as those are then available to all users. The lsdal.ini file may not be correctly updated if: - You have created the BI Link IDs while using PAS in Client Server Mode - You have enabled multi user access for remote desktop. In this case an additional lsdal.ini file may appear in the user specific Windows directory of someone who may have remotely connected to the system to create the Link ID. That additional lsdal.ini file will only be valid for that specific user.
    Also try adding  "ODBOSECURITY=0" entry to the end of the c:\windows\lsserver.ini file on the server.
    hope it helps
    regards
    laksh

  • How Do I Repeat A Formula Over and Over?

    New to Numbers. Have a document with 90 rows. I have had to enter in the same formula over and over on every other row, except that I have to change the row #.
    i.e. The formula I use is:
    =SUM(C2:H2). Then the next line is: =SUM(C4:H4)
    I am up to row 20, and have to think there is a better way than doing it over and over again. Is there?

    Since you are creating the equation in every other row, you can copy then paste and the references will adjust. If you were copying all rows, just select the "o" at the bottom right hand of the cell with the equation, and drag down.
    Regards,

Maybe you are looking for