Scalar distance across columns

I need to calculate the scalar (Euclidean) distance between two vectors, each dimension represented by columns in a table. I have a procedure that does it the slow and painful way: loop over all vector pairs/loop over all columns/look up the individual cell values/sum over all the differences. It appears to me though, that there should be a more straightforward way to do this using the:
SELECT * FROM TST INTO vREF_DATA WHERE REGNO=1;
SELECT * FROM TST INTO vCMP_DATA WHERE REGNO=2;
syntax in PL/SQL, then loop over the variables/column elements to sum the differences. However, I can't figure out how to keep the pointers for each variable in sync.
E.g.: coord1(1,2,3), coord2(2,3,1), differences(1,1,2), sum=4.
I can do this in Perl using hashes/arrays, but not in PL/SQL. What is the right frame/syntax to do this? If it were a couple of hundred rows, I'd do it in Perl, but with millions of rows and hundreds of columns, it gets real tedious, not to mention easily out-of-sync with the database contents.
I'd appreciate any suggestions!

Michiel:
Glad that it works for you. So, you want a fishing lesson :-).
First, the full documentation for the DBMS_SQL package can be found here .
Essentially, DBMS_SQL is an industrial strength version of EXECUTE IMMEDIATE (well, properly, EXECUTE IMMEDIATE is a highly simplified version of DBMS_SQL, since DBMS_SQL came first). It has many advantages over EXECUTE IMMEDIATE because it allows you full control over virtually everything to do with the query. So, you can relatively easily create bind variables on the fly to create statements with an unknown number of binds. It also allows you to find the columns from any arbitrary query through DBMS_SQL.Describe_Columns.
You never actually see any values returned, because I never actually return any. Since you wanted your output in another table, I decided to build one big insert statement, rather than iterate through all the rows, calculate the distance, and then insert one row at a time. It seemed more efficient to me. I also decided to "hard code", through a bind variable, each of the column values from the ref_id, rather than try to dynamically build a join, which seemd simpler to me.
1. DBMS_SQL.Describe_Columns returns a table of records, one record for each column, that gives information much like that in the xxx_tab_columns views. If some id columns may be numeric, you can test the col_type field in the table of records and put a dummy VARCHAR variable into the character columns. Just be aware that the col_type field returns a numeric version of the column_type, not a string. If you look at the text from user_tab_cols:
SELECT text
FROM dba_views
WHERE view_name = 'USER_TAB_COLS'You can see where Oracle DECODES the numeric type to the NUMBER, VARCHAR2 etc. Essentially, NUMBER is 1 and VARCHAR2 is 2.
2. I replaced the FOR scale_rec IN ... LOOP block with another DBMS_SQL built query to pull the AVG and VARIANCE from the table, it is commented in the code below.
3. You cannot really put a threshold on the computation of the distance, since the distance is not really known to the query until it is fully executed (i.e. at the time of inserting). However, you could modify the insert query to filter values with distances greater than 3. I will leave that modification as a exercise for the fiherman, but the end sql statement would look something like:
INSERT INTO diag
SELECT src, id, dist
FROM (SELECT :src_id src, id,
        SQRT(ABS((POWER((:sc2 - :mean2)/:var2, 2) - POWER((col1 - :mean2)/:var2, 2))+
                 (POWER((:sc3 - :mean3)/:var3, 2) - POWER((col2 - :mean3)/:var3, 2))+
                 (POWER((:sc4 - :mean4)/:var4, 2) - POWER((col3 - :mean4)/:var4, 2)))) dist
      FROM t
      WHERE id <> :src_id)
WHERE dist <= 3Now here is a heavily commented version taking into account the proper formula.
CREATE or replace PROCEDURE euclidean_distance (p_src_tab IN VARCHAR2) AS
   -- Associative Array for scaling factors
   TYPE scale_cols_tp IS TABLE OF NUMBER INDEX BY VARCHAR2(30);
   mean_cols scale_cols_tp; -- Will hold average of columns
   var_cols scale_cols_tp;  -- Will hold variance of columns
   -- Array to hold column values for the reference id
   TYPE src_cols_tp IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
   src_cols src_cols_tp;
   l_dummyn NUMBER;  -- Dummy Number for Define Column
   l_ignore NUMBER;  -- Receives rows processed from queries
   l_sqlstr VARCHAR2(32767);  -- For sql statements
   src_cur  NUMBER;  -- Reference ID Cursor handle
   src_tab  DBMS_SQL.Desc_Tab;  -- Table of Records describing passed table
   src_col_cnt NUMBER;   -- Number of columns in passed table
   ins_cur  NUMBER;  -- Insert Cursor handle
   mv_cur  NUMBER;  -- Cursor handle for Mean and Variance of table
   l_col_pos NUMBER; -- Index into src_tab
   l_res_pos NUMBER; -- Column position in mv_cur
   l_x1     VARCHAR2(10);  -- Dynamic bind variable for source column values
   l_x2     VARCHAR2(30);  -- Column name from source columns
   l_meani  VARCHAR2(10);  -- Dynamic bind variable for mean of table
   l_vari   VARCHAR2(10);  -- Dynamic bind variable for variance of table
BEGIN
   -- Get a "handle" for a cursor, and parse the query
   src_cur := DBMS_SQL.Open_Cursor;
   DBMS_SQL.Parse(src_cur, 'SELECT * FROM '||p_src_tab||' WHERE id = :src_id',DBMS_SQL.Native);
   -- Describe the table to get number of columns, their names and their types
   DBMS_SQL.Describe_Columns(src_cur, src_col_cnt, src_tab);
   -- I now have a table of records (src_tab) showing similar info
   -- to that shown in xxx_tab_columns, one record per column
   -- and the number of columns in the table (actually the number of records
   -- in src_tab) is in src_col_cnt
   -- Define the column types for src_cur.  This just tell DBMS_SQL that
   -- the column at position i (based on the column list in the select)
   -- is of the passed data type.  It is not setting a variable to
   -- receive the column value.
   -- I am assuming all inluding ID are NUMBER.
   -- If id may be alpha can test src_tab(i).col_type to check data type
   FOR i IN 1 .. src_col_cnt LOOP
      DBMS_SQL.DEFINE_COLUMN(src_cur, i, l_dummyn);
   END LOOP;
-- This section replaces the FOR scale_rec IN LOOP
   -- Get mean and variance for passed table
   -- Build the sql statement
   l_sqlstr := 'SELECT ';
   FOR i IN 2 .. src_col_cnt LOOP
      l_sqlstr := l_sqlstr||'AVG('||src_tab(i).col_name||'),'||
            'VARIANCE('||src_tab(i).col_name||'),';
   END LOOP;
   -- l_sqlstr is now:
   -- SELECT AVG(col1), VARIANCE(col1),AVG(col2), VARIANCE(col2),
   --        AVG(col3), VARIANCE(col3),
   -- So trim the trailing , and add FROM
   l_sqlstr := RTRIM(l_sqlstr,',');
   l_sqlstr := l_sqlstr||' FROM '||p_src_tab;
   -- Set up the cursor
   mv_cur := DBMS_SQL.OPEN_CURSOR;
   DBMS_SQL.Parse(mv_cur, l_sqlstr, DBMS_SQL.Native);
   -- Getting 2 results (AVG and VARIANCE) for each column
   -- and we know that they are all numeric
   -- but need to ignore the id column so
   FOR i In 1 .. (src_col_cnt - 1) * 2 LOOP
      DBMS_SQL.DEFINE_COLUMN(mv_cur, i, l_dummyn);
   END LOOP;
   -- Now Run the query and assign columns into associative array
   l_ignore := DBMS_SQL.EXECUTE_AND_FETCH(mv_cur);
   l_col_pos := 2;  -- start in Record 2 of src_tab
   l_res_pos := 1;  -- start in Column 1 of result set
   WHILE l_col_pos <= src_col_cnt LOOP
      DBMS_SQL.COLUMN_VALUE(mv_cur, l_res_pos, mean_cols(src_tab(l_col_pos).col_name));
      DBMS_SQL.COLUMN_VALUE(mv_cur, l_res_pos + 1, var_cols(src_tab(l_col_pos).col_name));
      l_col_pos := l_col_pos + 1;
      l_res_pos := l_res_pos + 2;
   END LOOP;
   -- I end up with two associative arrays, both indexed by column name
   -- mean_cols values are the average for each column
   -- var_cols values are the variance for each column
   -- We're done with this query so
   DBMS_SQL.Close_Cursor(mv_cur);
-- END replacement FOR scale_rec IN LOOP
   -- Build the insert statement
   -- I took the ABSolute value of the SUM of L(i) because with
   -- my data I was getting negative values which blew the SQRT
   l_sqlstr := 'INSERT INTO diag SELECT :src_id, id, SQRT(ABS(';
   FOR i IN 2 .. src_col_cnt LOOP
      -- Dynamically create bind variables to hold "fixed" values
      -- (i.e. reference values, mean, and variance
      -- and plug the correct column names for the target columns
      l_x1 := ':sc'||i; -- For i = 2 gives :sc2
      l_x2 := src_tab(i).col_name; -- For i = 2 gives COL1
      l_meani := ':mean'||i; -- For i = 2 gives :mean2
      l_vari := ':var'||i; -- For i = 2 gives :var2
      -- Append this column formula to sql statement
      l_sqlstr := l_sqlstr ||'(POWER(('||l_x1||' - '||l_meani||
                  ')/'||l_vari||', 2) - POWER(('||l_x2||' - '||
                  l_meani||')/'||l_vari||', 2)) + ';
   END LOOP;
   -- Here, l_sqlstr is:
   -- INSERT INTO diag
   -- SELECT :src_id, id, SQRT(ABS((POWER((:sc2 - :mean2)/:var2, 2) -
   --                               POWER((col1 - :mean2)/:var2, 2))+
   --                              (POWER((:sc3 - :mean3)/:var3, 2) -
   --                               POWER((col2 - :mean3)/:var3, 2))+
   --                              (POWER((:sc4 - :mean4)/:var4, 2) -
   --                               POWER((col3 - :mean4)/:var4, 2))+
   -- so get rid of the trailing + and space
   l_sqlstr := RTRIM(l_sqlstr,'+ ');
   -- Now close the open bracket from SQRT and ABS and add FROM and WHERE
   l_sqlstr := l_sqlstr||')) FROM '||p_src_tab||' WHERE id <> :src_id';
   -- Now we have a valid insert statement so
   -- Prepare and parse the insert cursor
   ins_cur := DBMS_SQL.Open_Cursor;
   DBMS_SQL.Parse(ins_cur, l_sqlstr, DBMS_SQL.Native);
   -- bind in the mean and variance which are fixed for this set of columns
   FOR i IN 2 .. src_col_cnt LOOP
      DBMS_SQL.Bind_Variable(ins_cur,':mean'||i, mean_cols(src_tab(i).col_name));
      DBMS_SQL.Bind_Variable(ins_cur,':var'||i, var_cols(src_tab(i).col_name));
      -- for i = 2, These two calls resolve as:
      -- DBMS_SQL.Bind_Variable(ins_cur,:mean2, mean_cols(COL1));
      -- DBMS_SQL.Bind_Variable(ins_cur,:var2, var_cols(COL1));
      -- which means bind the value found in mean_cols('COL1') to
      -- the bind variable :mean2 and the value found in var_cols('COL1') to 
      -- the bind variable :var2
   END LOOP;
   -- Get the reference IDs
   FOR intrest_rec IN (SELECT ref_id FROM query) LOOP
      -- For each reference ID bind into the source query
      DBMS_SQL.Bind_Variable(src_cur,':src_id', intrest_rec.ref_id);
      -- So, here, on the first iteration, we are about to execute
      -- the statement
      -- SELECT * FROM t WHERE id = 1     
      l_ignore := DBMS_SQL.Execute_And_Fetch(src_cur);
      -- Get the column values from each source row and
      -- bind that value (e.g. 1 in my sample) to variable :src_id
      DBMS_SQL.Bind_Variable(ins_cur,':src_id', intrest_rec.ref_id);
      FOR i IN 2 .. src_col_cnt LOOP
         -- Retrieve the value of each column of the source row
         -- into the table of NUMBERS
         DBMS_SQL.COLUMN_VALUE(src_cur, i, src_cols(i));
         -- Then bind it into the insert cursor
         DBMS_SQL.Bind_Variable(ins_cur,':sc'||i, src_cols(i));
      END LOOP;
      -- execute the insert statement
      l_ignore := DBMS_SQL.EXECUTE(ins_cur);
   END LOOP;
   COMMIT;
   DBMS_SQL.Close_Cursor(src_cur);
   DBMS_SQL.Close_Cursor(ins_cur);
END;If you still have questions, I will be around until Thursday, then back January 4.
John

Similar Messages

  • Keep together gropus across columns

    Hello! I'm creating a lot of reports with Crystal Reports for Visual Studio 2010, and I'm unable to keep togheter groups across columns. This funcionality only works across pages.
    I've benn searching a lot in this forum and others and it appears that it's impossible to do this. And it also appears that the problem has been there for many years and still no solutions for this issue.
    This is a huge weakness for Crystal Reports, because displaying details in colums is very useful for many reasons, so I want to know if anyone has found any kind of solution for this and if there will be a solution soon.
    Thanks in advance.

    hi Gustaav,
    questions:
    1) are you referring to a Multi-Column report where you want to force the new group to start in a new column?
    2) if a group is longer than one column do you want it to start on a new column as well?
    3) if a group is longer than one column, do you want to have the group header repeated on the 2nd, 3rd... columns?
    jw

  • Distance between columns

    Hi all,
    I know we have a property called distance between records to maintain distance between records, what property i have to set to maintain a distance between columns.....

    I use the following method often:
    Once you have all columns displayed on your canvas, select all of them, then use the pulldown menu: Layout, Align components. Set "Align To" to "each other", set "Vertically" to "None", and "Horizontally" to "distribute", then click ok.
    (In Forms 6i, the pull-down is Arrange, Align Objects.)

  • Dragging one cell value(copy) across columns or across rows in ALV layout

    Hi friends,
    In bps layouts, data is displayed in ALV grid as interface. At plng folder level, can i incorporate excel feature like dragging one cell value across columns or across rows?  Simply if user enter one value in cell of ALV grid, that should be copied automatically across rows/columns while dragging?
    Second question, even i chose in layout builder excel as interface, that layout showed in plng folder as ALV grid layout. Why it happens so. I read documentation in UPSPM of that particular plng folder, it tells same thing(even if u choose excel, it will show in ALV only). So how can i get excel interface in plng folder?
    Regards,
    Kumar

    requested property is not possible at ALV layout level. Provided text document load facility to user. So user can directly load excel to plng folder.
    Issue resolved.

  • Problem in printing across columns

    Hello,
    I have a requirement to print the records across, for which I created the RTF template and was able to print across using @column.
    But here is the problem..
    eg:
    item,                                     reference1,        reference2,          reference3,            attribute1,         attribute2
    LOT-10201, AT-123, AT-128, AT-423, PCK012, PCK900
    LOT-10202, AT-111, AT-124, PCK910, PCK991
    At any time there is a maximum of three references for an item. The first record has three references and prints neat. But as the second record has only two references, the attribute1 column starts at reference3 for this.
    How can I make sure that if there are two references leave the reference3 as null and print attribute1 and attribute2 properly.
    like
    item, reference1, reference2, reference3, attribute1, attribute2
    LOT-10201, AT-123, AT-128, AT-423, PCK012, PCK900
    LOT-10202, AT-111, AT-124, , PCK910, PCK991
    Thanks
    S Gupta

    Refer
    http://winrichman.blogspot.com/2008/09/crosstab-with-multiple-repeating.html
    http://winrichman.blogspot.com/2008/08/pivot-table-cross-table-with-fixed.html
    http://winrichman.blogspot.com/2008/08/cross-tabs-problem-with-grouping-and.html
    Have a look at the third link, thats the one, you have use as sample.
    if, Still not able to get it
    Pass me the template :) and xml

  • Summing across columns

    Sorry, this is a very basic question that I haven't found the answer to when searching.
    I am setting up a basic table to keep track of business receipts.  I would like the total to be automatically filled in as I tab across the row.
    I have  Amount   Tax   Shipping     Total    after I fill in the columns, is it possible for the total to be automatically summed?
        ie        $10.00   $0.50                   $10.50
    I've tried a few ways, but have not gotten it to work on each row.
    Thanks
    - Jill

    Sure, you can sum across as easily as you can down. In this screenshot I used your figures & selected the three cells across & then dragged the sum shortcut to the last cell. You can then fill down with that formula by dragging the tiny circle.

  • DAX: Sum unique values across columns

    Hello,
    How do I sum unique values of "Yes" across my columns in DAX?
    It should look like this with [Total Yes] being my calculated column:
    Name
    January
    February
    March
    Total Yes
    Bob
    Yes
    Yes
    No
    2
    Jim
    No
    Yes
    No
    1
    Mark
    No
    No
    Yes
    1
    Thanks!
    ~UG

    Simply this
    =IF([January]="Yes",1,0)+IF([February]="Yes",1,0)+IF([March]="Yes",1,0)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Drilldown across columns with a structure

    Hi,
    In my Columns i had a structure with elements consisting of Selections/restrictions on Cal Year/Month -Current Cal Month and Offsets
    In my Rows i have KF.
    So the columns are Cal Year/Mon
    When i Drilldown across rows on Cal Week/year,Under each month it is displaying all the list of weeks based on Cal Year/Month  insted of weeks for that month
    Please update how to correct this

    In your structure, select its properties and enable the Suppression on the structure.
    Regards
    Gill

  • Maximum distance across any axis (circumscription)?

    I posted this in general "Illustrator", but I think it might be better suited here.
    I'm looking for a way to constrain an object to a size across any axis. For example, a 3" x 4" rectangle has a maximum height (or width) of 4". But it will not fit inside a circle with a 4" diameter. If you rotate the rectangle 45°, it now has a width of 4.9498" and a height of 4.9497". This works fine when the diagonal is obviously the longest measurement.
    But what about irregular shapes (the one I'm working with is the outline of a padlock)?
    The center point moves depending on the rotation, and some paths have so many points, finding the two furthest from each other is almost impossible. Any good ideas for finding the longest edge-to-edge distance? I figure once I can do that, I can then scale by percentage to the size I'm looking to fit.
    Thanks!

    It's the classic geometric problem of finding the smallest bounding circle for a given set of points (or for an irregular polygon). There are algorithms for doing it, but they are not simple. However, even pursuing them for the purpose stated is most likely a fruitless endeavor, because of two problems, one geometrically exacerbating; the other aesthetic:
    Remember, the purpose is to find a bounding circle to tightly enclose something drawn in Illustrator--basically, an icon in a tightly-fitting circle.
    The goemetric complication is that most attempts at solving the smallest bounding circle assumes a scatter plot of points or corners of an irregular polygon. But in the context of an icon drawn in Illustrator, those methods overlook the fact that the extrema of the shape might just as likely be somewhere along curved Bezier segments as at actual anchorPoints. So a real geometric solution would have to include an algorithm for positioning points at those outlying curve edges. The padlock subject of the original post is just such a case-in-point. The largest diameter of the figure clearly happens to fall somewhere in the middle of curved segments at both ends.
    But even if you expend the scripting energy to solve for all that, there still remains a practical consideration that defeats the whole purpose: Suitability of the resulting design. Again, the specific artwork shown is a case-in-point. You can easily approximate the smallest bounding circle for that padlock figure manually in Illustrator, without the need to resort to any scripting or other automation. But after doing so, you'll likely find the result visually unsatisfactory: the padlock will not appear to be centered in the circle. Thus, graphic discernment is going to come into play anyway, and a bounding circle other than the smallest is, more often than not, going to be the most desirable.
    Again, boiling the problem down to the simplest figure--a circumscribed triangle--serves to prove that problem as well:
    Geometry dictates that for any right triangle circumscribed by its smallest bounding circle, the hypoteneus will be a diameter of the circle. You can demonstrate that by:
    1. Draw a circle.
    2. Draw one diameter.
    3. Select any other point on the circle.
    4. Connect the added point to each end of the diameter, and the resulting three lines will always result in a right triangle.
    The above exercise clearly results in the right triangle being circumscribed by its smallest bounding circle. But would you call that triangle "centered" in the circle? Certainly not. The right triangle, by necessity, occupies only one half of the circle.
    Now move the corner point that forms the right angle a little outboard of the circle. What you are now viewing should clearly demonstrate the rule already explained: that the longest diameter of the original artwork (in this case, the former hypoteneus) cannot be the diameter of even an enclosing circle if any third point of the figure forms an accute angle with the diameter's two ends.
    There is, of course, a single minimum bounding circle for this new triangle, but once you find it, you will still see that the triangle is not "centered" in the circle. It will be "better centered" than the former right triangle, but it will never become what anyone would call "visually centered" or "balanced" until you've move that third point around so as to form an equilateral triangle. In other words, among triangles, only an equilateral triangle will ever appear what we would call "centered" in its minimum bounding circle. That problem is even more likely in the far more variable possibilities of irregular polygons, let alone all the many shapes that can be drawn in Illustrator, including those with curved segments defining their extremes.
    There is a very simple and practical method for achieving what RSDD wants without resorting to scripting or even simple math. It was explained to him in his first thread on this question in the Illustrator general discussion forum. But he offhandedly dismissed it on the grounds that "it can't be that simple."
    JET

  • BSIS - GROUP By Week Across Columns

    I am new to ABAP Query...Using SQ01 to create a query of BSIS table.
    I ultimately want to pull all cost center (KOSTL), account (HKONT) combinations in Local Currency (DMBTR) and GROUP the data by week based on posting date (BUDAT).  I want the weeks as columns in the query.
    Report...                  Week 1          Week 2         Week 3         Week 4
    KOSTL, HKONT          XX                    XX                 XX                XX
    Can anyone please help me with how to make this happen.  Do I need to use ABAP code?
    Thanks

    that's not possible without abap coding - better write an abap-report:
    - that's your internal table:
    begin of itab..
          hkont,
          kostl,
          week,
          wrbtr,...
    -use fm DATE_GET_WEEK to convert BUDAT into week.-no.
    hope that helps
    A.

  • Straddling headlines across columns

    Anyone? I thought there was a way to keep all the type/styles together in one text block. I'm not seeing a place to tell the "headline" to straddle the 5 columns I have. Am I dreaming or was that Quark that could do that?
    Thanks

    I think you're dreaming :-) FrameMaker could do that too, with a nifty paragraph setting to span the columns. It would be nice if that were added in the next upgrade...
    In the mean-time, I made myself a little Applescript whose function is to split the current column below the insertion point. I gave it a keyboard shortcut, and now I can put the cursor in the first line of the heading, press control-Q, and the column splits. I drag the right-most handle to span the text, and Text Wrap takes care of the rest.
    This may be hard to read without the indents, but if you paste it into the Script Editor it will become clearer. And someone with more scripting skill than I have may be able to compose a better one:
    tell application "Adobe InDesign CS3"
    set mySelection to item 1 of selection
    set myFrames to parent text frames of item 1 of selection
    set myFrame to item 1 of myFrames
    set myStory to parent story of item 1 of mySelection
    set mypage to parent of myFrame
    tell text frame preferences of myFrame
    set first baseline offset to leading offset
    end tell
    set TextBaseline to baseline of mySelection
    set OriginalBounds to geometric bounds of myFrame
    set OriginalTop to item 1 of OriginalBounds
    set OriginalLeft to item 2 of OriginalBounds
    set OriginalBottom to item 3 of OriginalBounds
    set OriginalRight to item 4 of OriginalBounds
    set geometric bounds of object reference of myFrame to {OriginalTop, OriginalLeft, TextBaseline, OriginalRight}
    tell mypage
    set NewFrame to make text frame with properties {geometric bounds:{TextBaseline, OriginalLeft, OriginalBottom, OriginalRight}}
    tell text frame preferences of NewFrame
    set first baseline offset to leading offset
    end tell
    end tell
    try
    set NextFrame to next text frame of myFrame
    end try
    set properties of myFrame to {next text frame:NewFrame}
    try
    set NextFrame to next text frame of NewFrame
    end try
    set selection to insertion point 1 of NewFrame
    end tell

  • How to Merge and Sum across columns??

    Hey guys I have an interesting Problem (at least interesting to me:p). I am trying to figure out how to use numbers to collate or group certain column data and then sum the values of the grouped data. below is a snippet from my an error log i've parsed. The final step I need to do is to create a 3 column output where the values are - Error (merged), # Errors (SUM), Error Detail(merged).
    I hope this makes sense and any help is greatly appreciated.
    24900 291 Client/zimpErrVal.h
    24900 96 Client/zimpErrVal.h
    24900 82 Client/zimpErrVal.h
    15007 700 Alllocation/zsmErrVal.h
    15209 15274 Session/zapErrVal.h
    15209 228 Session/zapErrVal.h
    15209 2447 Session/zapErrVal.h
    best,
    Curtis
    Message was edited by: Curtis Wiilliams

    Well there is a lot of interesting stuff going one here. The Hidden Col formula works great when the Err Code Col is sorted. When Err Code is random, the Hidden Col repeats counts some Err Codes twice thus giving an incorrect total...
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    whereas the sorted Err Code returns the values I think your formula intended
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    Also for some reason I can't get the Table 2 - Col A formula to recognize Table 1 - Err Code as a reference???
    =IF(ROW()-1>MAX(Table 1 :: Hidden),"",LOOKUP(ROW()-1,Table 1 :: Hidden,Table 1::'Error Code'))
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    how the heck do you post a screenshot???
    Message was edited by: Curtis Wiilliams
    Message was edited by: Curtis Wiilliams

  • Data Mining - Scalar Mining Structure Column Data type error...

    Hoping someone will have a solution for this error
    Errors in the metadata manager. The data type of the '~CaseDetail ~MG-Fact Voic~6' measure must be the same as its source data type. This is because the aggregate function is not set to count or distinct count.
    Is the problem due to the data type of the column used in the mining structure is Long, and the underlying field in the cube has a type of BigInt,or am I barking up the wrong tree?

    You're right the error does occur when processing the mining model. I've built a simple mining structure to look into the problem - its just a decision tree based on a cube. The cube itself has a single Fact table, with numerous related dimensions. It has two measure groups - one for the use of distinct count, in the other group the aggregation functions used are count and sum.
    The measure which seems to be causing a problem uses the sum aggregation in the cube. The underlying table has this field as a BigInt, which was used due to round issues on the cubes when the original Int datatype was used.
    In the mining model the same field appears as a Continuous with datatype of Long. It has been tried in various guises as predictonly, and ignore modes both with the same results.
    The mining model used to work without a problem when the underlying type was an Integer, but then the cube would report the wrong figures.
    Interestingly, when I build a mining model directly against the source data there were no problems.
    Let me know if you need any further information.
    Thanks

  • Restore the view so I can drag div widths across columns.

    I am working in DW CC and on a fluid grid layout. When I first started building the page, I had the view options where I could drag the width of the div to change the number of columns the div would span. I was also able to hit the "up" button and was able to push that div up to the line above it. Say, for creating horizontal navigation.
    Now I don't know how to make these view options return. Could someone please help me? I want to be able to drag the wdith of my divs again. Thanks for your help!

    Thank you for your prompt response Nancy. I am not sure if I have changed the boilerplate file. I guess I could have changed something by accident, but I know I did not intentionally change anything. Also, I do not have a FluidGrid.css file. Yikes! How do I get that?
    I have the following files:
    bolierplate.css
    contentsyle.css (my externaly style sheet)
    index3.html
    images (folder)
    respond.min.js
    style3.css
    I don't have these pages hosted live anywhere yet since I am still building it. Would it help if I posted the code of one of these files?
    Thanks again for your help. I really do appreciate it.

  • Aligning body copy after a headline, across columns.

    This is a lot easier to show than to explain. Please see attached image.
    I can come up with a couple of ways to "cheat" this result, but I'm convinced there has to be an easier, more future-editing-friendly way to do it!
    I'm using IND CS3 on a Mac.

    This is one of those features that FrameMaker did rather nicely, but Indesign doesn't at all. I'm one of those who think that text column definitions (number of columns, spacing, etc.) should be a paragraph attribute, not a frame attribute. But I came to this business as a book typesetter, not a magazine layout artist, and I suspect that the designers of Indesign are mostly in the latter group.
    I did write an AppleScript that splits the current frame into two connected frames, with the division located just below the current insertion point. This can be used to divide up the page into multiple frames for changing the column numbers. But it's not a solution that is friendly to future edits.
    For anyone interested, here's the script:
    tell application "Adobe InDesign CS4"
    set mySelection to item 1 of selection
    set myFrames to parent text frames of item 1 of selection
    set myFrame to item 1 of myFrames
    set myStory to parent story of item 1 of mySelection
    set mypage to parent of myFrame
    tell text frame preferences of myFrame
    set first baseline offset to leading offset
    end tell
    set TextBaseline to baseline of mySelection
    set OriginalBounds to geometric bounds of myFrame
    set OriginalTop to item 1 of OriginalBounds
    set OriginalLeft to item 2 of OriginalBounds
    set OriginalBottom to item 3 of OriginalBounds
    set OriginalRight to item 4 of OriginalBounds
    set geometric bounds of object reference of myFrame to {OriginalTop, OriginalLeft, TextBaseline, OriginalRight}
    tell mypage
    set NewFrame to make text frame with properties {geometric bounds:{TextBaseline, OriginalLeft, OriginalBottom, OriginalRight}}
    tell text frame preferences of NewFrame
    set first baseline offset to leading offset
    end tell
    end tell
    try
    set NextFrame to next text frame of myFrame
    end try
    set properties of myFrame to {next text frame:NewFrame}
    try
    set NextFrame to next text frame of NewFrame
    end try
    set selection to insertion point 1 of NewFrame
    end tell

Maybe you are looking for

  • Hp recovery issues?

    Okay you guys, i'm in need of a little help here. I just went through the system recovery discs. It says it's done, and to its credit, it does look like it's completely restored windows 7. However now, when i attempt to access the internet, it freaks

  • How to segment red target in a image and caculate the L*a*b* value

    hello,  Anyone can tell me how to segment a color image? This image contains red.white and black background.  I want the red and white parts, and caculate each parts' L*a*b* value.  Thank you very much.  rex

  • Menu expanding off of page - Please Help!!!

    I've placed a vertical menu on the left side of my page where some of the sub-menu items extend lower than the visible bottom of the page. My question is: is there a way to have the page automatically scroll down to see the items? Right now when the

  • Director 12 (subscription) won't publish projector

    I just purchased Director 12, subscription model, this morning. I am frustrated to say the least that it won't publish a simple projector on my system. It uses two xtras, BudAPI, and ImgXtra, but even if I remove them from the project, D12 still won'

  • Firefox shows incorrect information about downloading file

    Hi there, I dont know what is goin on, firefox shows e.g 500kb/s and 5 minut left, but it takes much more time... what can be wrong ? thanks Last edited by chosen (2012-03-10 22:39:54)