Dynamically rollup dimension and aggregate data based on diferent measures

Hi,
I am facing an issue while rolling up the dimension based upon measures. I have a dimension which is defined at 3 levels - Level1 (L1), Level2  (L1), Level3 (L1). There is a unique code for each of these dimensions. It might be possible for a L1, there is no L2 and L3 or for a L1 there is L2 but no L3.
Universe structure looks like:
Table1--Table2Table3Table4Table5Table6
Table1 is my master table that gives heirarchy i.e. has Level number, Code, ParentCode and Name.
Table2 is a fact table which has Amount and Code. Amounts are present at the most granular level L1 or L2 or L3.
Table3 and Table5 are tables joined to Table 2 and Table 4 through some IDs which are used as user prompts.
Table6 is a fact table which has L1Code,L2Code,L3Code and Targets.
So table1 and table2 has all the codes in one column and Table 6 has codes in 3 different columns depending upon level (hierarchy) along with targets.
My requirement is to show Names from Table1 for which targets are defined in Table6 along with the Amount.
1. If target is at L3 then Show Name of L3, Amount and targets.
2. If target is at L2 then show Name of L2, 
    a) Sum of all L3 Amounts under that L2 aggregated to L2 and Target for L2.
    b) Sum of L2 Amount (if L2 is most granular level) and Target for L2.
3. If target is at L1 then show Name of L1,
    a) Sum of all L3 (or L2 depending upon more granular level for that L1) Amounts under that L1 aggregated to L1 and Target.
    b) Sum of all L1 (if L2 is most granular level) Amounts and Target.
We are able to achieve Roll up of dimension based upon Targets but aggregation of Amounts from L3 to L2 or L2 to L1 based upon these rollups is not happening.
Please Help.

Hi ,
As you mentioned you need such aggregation in SSRS and you are using SSAS datasource.
so you can achieve this using MDX Query.
I have done this in my environment . I took below for achieving this
Dimension : Category
Relationship : There should be Facttable relationship with Dimension table Category.
Measure : Unit Price (in your case sale)
Please find below solution using MDX Query.
Please share if you have any doubt.
Thanks

Similar Messages

  • Creating scenario dimension and loading data

    Hi all,
    We have two fact tables. The first one is sales that include quantity and subtotal columns. The other one is budget that include quantity and subtotal. We are working with hyperion essbase 9.3. First of all we are creating two model. For sales model we create 7 dimensions (product, chanell, time, company, currency, customer, account) and 3 attribute dimension and for budget model we create 4 dimensions (account,company,customer,product) in metaoutline. And we create 2 application for each metaoutline. We plan to report sales vs budget but we don't know how to join sales and budget data. Everybody recommends scenario dimension. we don't know how to create sceneraio dimension and in which application Essbase integration or Essbase administration services.
    thank you.

    I agree with Cameron. The best way is to put them into one cube. Since you are using a SQL source you can manulate it to have your budget load to the same time level as your actuals. For example suppose you load actuals daily and Budget is Monthly. for consistancy, you could load the budget data into the 15th day of the month. At the Monthly level where you would compare budget to actual, the numbers will be correct. Loading into dummy members for the dimensions that don't exist for budget is a common practice when trying to sync up data. If you really want to make it easy, you could union a view to make it look like you have a single fact table (based on the combo of budget and actual) and have a single metadata outline to load everything. I prefer having two because of different load requirements, but this is an option.
    If you don't want to go this way, the next option is to partition your budget data into the actuals cube. this would keep them seperate but allow you to see them togeter. Between the two option, I prefer the single cube approach better

  • Search for columnName and Split data based on that column name

    Hi All,
    I have a table with one column, lets say Notes of datatype varchar(max).
    Source Date:
    Notes
    ABC:123:XYZ Dept:IT NameID:1 Name:Tom Hummer Date:04/12/2004
    456789:CDEF:ADEF
    CBD:12/12/2000:ZXCV Dept:HR NameID:1 Name:Sam Dope Date:06/17/2005
    I want Output should look like below. It should split data at 'Dept:' and 'Name:' I need SQl code  for SQL Server 2008 R2
    Output:
    Notes
    Dept:IT Name:Tom Hummer
    Dept:HR Name:Sam Dope
    Thanks,
    RH
    sql

    Hello,
    Please refer to the following statements:
    create table notes (note varchar(max));
    insert into notes values
    ('ABC:123:XYZ Dept:IT NameID:1 Name:Tom Hummer Date:04/12/2004'),
    ('456789:CDEF:ADEF'),
    ('7890:RST:QWER Dept:Sales NameID:2 Name:Mike Kule'),
    ('CBD:12/12/2000:ZXCV Dept:HR NameID:1 Name:Sam Dope Date:06/17/2005')
    select case
    when charindex('Name:',note)>0 and charindex('Date:',note)>0
    then SUBSTRING(note,charindex('Name:',note)-1,charindex('Date:',note)-charindex('Name:',note))
    when charindex('Name:',note)>0 and charindex('Date:',note)=0
    then SUBSTRING(note,charindex('Name:',note)-1,len(note)-charindex('Name:',note))
    end as name
    from notes
    where charindex('Name:',note)>0
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Relationship between Dynamic Memory Heap and Heap Data Structure

    This question is not strictly related to Java, but rather to programming in general, and I tend to get better answers from this community than any where else.
    Somehow, my school and industry experience have somehow not given me the opportunity to explore and understand heaps (the data structure), so I'm investigating them now, and in particular, I've been looking at applications. I know they can be used for priority queues, heap sorts, and shortest path searches. However, I would have thought that, obviously, there must be some sort of relationship between the heap data structure, and the dynamic memory heap. Otherwise, I can think of no good reason why the dynamic memory heap would be named "heap". Surprisingly, after searching the web for 90 minutes or so, I've seen vague references, but nothing conclusive (trouble seems to be that it's hard to get Google to understand that I'm using the word "heap" in two different contexts, and similarly, it would not likely understand that web authors would use the word in two different contexts).
    The Java Virtual Machine Spec is silent on the subject, as "The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements."
    I've seen things like:
    [of dynamic memory] "All the blocks of a particular size are kept in a sorted linked list or tree (I extrapolate that sorted tree could imply heap)"
    [of dynamic memory] "The free and reserved areas of memory are maintained in a data structure similar to binary trees called a heap"
    [of dynamic memory] "This is not related to the heap data structure"
    [of dynamic memory] "Not to be confused with the data structure known as a "heap"
    [of data structure] "Not to be confused with the dynamic memory pool, often known as TheHeap"
    At this point, I've come to surmise that some (but not all) memory management algorithms use heaps to track which (pages? blocks? bytes?) of memory are used, and which are not. However, the point of a heap is to store data so that the max (or min) key is at the root of the heap. But we might want to allocate memory of different sizes at different times, so it wouldn't make sense to key on the amount of available memory in a particular region of the free store.
    I must assume then that there would be a different heap maintained for each size of memory block that can be allocated, and the key must have something to do with the attractiveness of the particular memory block in the heap (perhaps the lowest address, resulting, hopefully, in growing the free store space less often, leaving more space for the stack to grow, or perhaps keyed based on the fragmentation, to hopefully result in less fragmentation, and therefore more efficient use of the memory space, or perhaps based on page boundaries, keeping as much data in the same page as possible, etc).
    So at this point, I have a few questions I've been unable to resolve completely:
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?
    2. If so, would it be correct that there would be a heap per standard block size?
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?
    Any insight would be awesome!
    Thanks,
    A.

    jschell wrote:
    I think you are not only mixing terms but domains.
    For starters the OS allocs memory. Applications, regardless of language, request memory from the OS and use it in various ways.
    There are many variations of the term "heap" like the following.
    [http://en.wikipedia.org/wiki/Heap_(data_structure)]
    [http://en.wikipedia.org/wiki/Dynamic_memory_allocation]
    A java VM will request memory from the OS (from a 'heap') and use it in its application 'heap' (C/C++) and then create the Java 'heap'. There can be variations of that along the way that can and likely will include variations of how each heap is used, potentially code that creates its own heap, and potentially other allocators which use something which is not a heap.This last part, I find a bit confusing. By "use something which is not a heap", do you mean the heap data structure, or the dynamic memory pool meaning of heap? If the former, then you would be implying that it would be common for a heap data structure to be used to manage the heap dynamic memory pool. If the latter, what would this "something which is not a heap" be? The best definition of "heap" I've found simply states that it is a pool of memory that can be dynamically allocated. If there is some other way of allocating dynamic memory, then it would suggest that the previous definition of "heap" is incomplete.
    >
    So to terms.
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?Which 'heap'? The VM one? It is probably named that because the implementors of the Sun VM were familar with how C++ and Smalltalk allocated memory.Okay, but that begs the question, was the heap in C++ and/or Smalltalk so named for the above queried reason?
    >
    2. If so, would it be correct that there would be a heap per standard block size?Not sure what you are referring to but probably a detail of the implementation. And since there are different levels the question doesn't mean much.
    However OS allocations are always by block if that helps. After that it requires making the question much, much more specific.
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?Again not specific enough. A typical standard implementation of heap could not be at the word level. And it is unlikely, but not impossible, that variations would support word size allocations.
    The VM heap might use word boundaries (but not size), where the application heap certainly does (word boundary.)My understanding of it is that the application would request blocks from the OS, and then something like malloc would manage the memory within the allocated blocks. malloc (or whatever equivalent Java uses) would have to keep track of the memory it has allocated somehow, and I would think it would have to do this at the word level, since it's most commonly going to allocate memory at the word level to be references to other objects, etc.
    So I guess my question here would really be, if the dynamic memory heap is so named because there has been a memory management strategy that relied upon a heap data structure (which I've found no proof, but have found some suggestive literature), then would that probably have applied at the OS Page Fault level, tracking allocated blocks, or would that have applied at the malloc level, allocating individual words as necessary?
    >
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?"Key" is not a term that will apply in this discussion.
    You appear to be referring to strategies for effective allocation of memory such as allocations from different regions by size comparison.
    It is possible that all levels might use such an allocator. General purpose applications do not sort allocations though (as per your one reference that mentions 'key'.) Sorry, I got the term "key" from an article I read regarding heaps, that indicates that a "key" is used to sort the elements, which I guess would be a more generalized way to make a heap than assuming a natural ordering on the elements in the heap. I'm not sure if the terminology is standard.
    >
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?Again too indefinite. The Sun VM uses a rather complicated allocator, the model for which originated after years of proceeding research certainly in Smalltalk and in Lisp as well, both commercially and academically.
    I am sure the default is rules driven either explicitly or implicitly as well. So it is self tuning.
    There are command line options that allow you to change how it works as well.I guess perhaps I could attempt to clarify my initial question a bit.
    There is a 1:1 correspondence between the runtime stack, and a stack data structure. That is, when you call a function, it pushes a stack frame onto the runtime stack. When you return from a function, it pops a stack frame from the runtime stack. This is almost certainly the reasons the runtime stack is named as it is.
    The question is, is there or has there ever been a 1:1 correspondence between some aspect of the dynamic memory heap or how it is managed, and a heap data structure? If so, it would explain the name, but I'm a bit puzzled as to how a heap data structure would be of assistance in creating or managing the dynamic memory heap. If not, on the other hand, then does anybody know where the name "heap" came from, as it applies to the dynamic memory pool?
    A.

  • Want to get placed images Dimension and Creation Date in Catalog

    Below is the script which is free with CS4. Is there anybody who can modify this script in a way which provide the creation date and dimension of the images in image catalog.
    //ImageCatalog.jsx
    //An InDesign C4 JavaScript
    @@@BUILDINFO@@@ "ImageCatalog.jsx" 2.0.0 5-December-2007
    //Creates an image catalog from the graphic files in a selected folder.
    //Each file can be labeled with the file name, and the labels are placed on
    //a separate layer and formatted using a paragraph style ("label") you can
    //modify to change the appearance of the labels.
    //For more information on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //Or visit the InDesign Scripting User to User forum at http://www.adobeforums.com .
    //The myExtensions array contains the extensions of the graphic file types you want
    //to include in the catalog. You can remove extensions from or add extensions to this list.
    //myExtensions is a global. Mac OS users should also look at the file types in the myFileFilter function.
    main();
    function main(){
    var myFilteredFiles;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    myExtensions = [".jpg", ".jpeg", ".eps", ".ps", ".pdf", ".tif", ".tiff", ".gif", ".psd", ".ai"]
    //Display the folder browser.
    var myFolder = Folder.selectDialog("Select the folder containing the images", "");
    //Get the path to the folder containing the files you want to place.
    if(myFolder != null){
       if(File.fs == "Macintosh"){
        myFilteredFiles = myMacOSFileFilter(myFolder);
       else{
        myFilteredFiles = myWinOSFileFilter(myFolder);
       if(myFilteredFiles.length != 0){
         myDisplayDialog(myFilteredFiles, myFolder);
         alert("Done!");
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
    var myFiles = new Array;
    var myFilteredFiles = new Array;
    for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
      myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
      if(myFiles.length != 0){
       for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
        myFilteredFiles.push(myFiles[myFileCounter]);
    return myFilteredFiles;
    function myMacOSFileFilter(myFolder){
    var myFilteredFiles = myFolder.getFiles(myFileFilter);
    return myFilteredFiles;
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
    var myFileType = myFile.type;
    switch (myFileType){
      case "JPEG":
      case "EPSF":
      case "PICT":
      case "TIFF":
      case "8BPS":
      case "GIFf":
      case "PDF ":
       return true;
       break;
      default:
      for(var myCounter = 0; myCounter<myExtensions.length; myCounter++){
       var myExtension = myExtensions[myCounter]; 
       if(myFile.name.indexOf(myExtension)>-1){
        return true;
        break;  
    return false;
    function myDisplayDialog(myFiles, myFolder){
    var myLabelWidth = 112;
    var myStyleNames = myGetParagraphStyleNames(app);
    var myLayerNames = ["Layer 1", "Labels"];
    var myDialog = app.dialogs.add({name:"Image Catalog"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       staticTexts.add({staticLabel:"Information:"});
      with(borderPanels.add()){
       with(dialogColumns.add()){
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Source Folder:", minWidth:myLabelWidth});
         staticTexts.add({staticLabel:myFolder.path + "/" + myFolder.name});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Images:", minWidth:myLabelWidth});
         staticTexts.add({staticLabel:myFiles.length + ""});
      with(dialogRows.add()){
        staticTexts.add({staticLabel:"Options:"});
      with(borderPanels.add()){
       with(dialogColumns.add()){
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Rows:", minWidth:myLabelWidth});
         var myNumberOfRowsField = integerEditboxes.add({editValue:3});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Number of Columns:", minWidth:myLabelWidth});
         var myNumberOfColumnsField = integerEditboxes.add({editValue:3});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Horizontal Offset:", minWidth:myLabelWidth});
         var myHorizontalOffsetField = measurementEditboxes.add({editValue:12, editUnits:MeasurementUnits.points});
        with(dialogRows.add()){
         staticTexts.add({staticLabel:"Vertical Offset:", minWidth:myLabelWidth});
         var myVerticalOffsetField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
        with (dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Fitting:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myFitProportionalCheckbox = checkboxControls.add({staticLabel:"Proportional", checkedState:true});
          var myFitCenterContentCheckbox = checkboxControls.add({staticLabel:"Center Content", checkedState:true});
          var myFitFrameToContentCheckbox = checkboxControls.add({staticLabel:"Frame to Content", checkedState:true});
        with(dialogRows.add()){
          var myRemoveEmptyFramesCheckbox = checkboxControls.add({staticLabel:"Remove Empty Frames:", checkedState:true});
      with(dialogRows.add()){
        staticTexts.add({staticLabel:""});
      var myLabelsGroup = enablingGroups.add({staticLabel:"Labels", checkedState:true});
      with (myLabelsGroup){
       with(dialogColumns.add()){
        //Label type
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Type:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelTypeDropdown = dropdowns.add({stringList:["File name", "File path", "XMP description", "XMP author"], selectedIndex:0});
        //Text frame height
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Height:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});
        //Text frame offset
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Offset:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});
        //Style to apply
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Label Style:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});
        //Layer
        with(dialogRows.add()){
         with(dialogColumns.add()){
          staticTexts.add({staticLabel:"Layer:", minWidth:myLabelWidth});
         with(dialogColumns.add()){
          var myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});
            var myResult = myDialog.show();
            if(myResult == true){
       var myNumberOfRows = myNumberOfRowsField.editValue;
       var myNumberOfColumns = myNumberOfColumnsField.editValue;
       var myRemoveEmptyFrames = myRemoveEmptyFramesCheckbox.checkedState;
       var myFitProportional = myFitProportionalCheckbox.checkedState;
       var myFitCenterContent = myFitCenterContentCheckbox.checkedState;
       var myFitFrameToContent = myFitFrameToContentCheckbox.checkedState;
       var myHorizontalOffset = myHorizontalOffsetField.editValue;
       var myVerticalOffset = myVerticalOffsetField.editValue;
       var myMakeLabels = myLabelsGroup.checkedState;
       var myLabelType = myLabelTypeDropdown.selectedIndex;
       var myLabelHeight = myLabelHeightField.editValue;
       var myLabelOffset = myLabelOffsetField.editValue;
       var myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];
       var myLayerName = myLayerNames[myLayerDropdown.selectedIndex];
       myDialog.destroy();
       myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName);
      else{
       myDialog.destroy();
    function myGetParagraphStyleNames(myDocument){
    var myStyleNames = new Array;
    var myAddLabelStyle = true;
    for(var myCounter = 0; myCounter < myDocument.paragraphStyles.length; myCounter++){
      myStyleNames.push(myDocument.paragraphStyles.item(myCounter).name);
      if (myDocument.paragraphStyles.item(myCounter).name == "Labels"){
       myAddLabelStyle = false;
    if(myAddLabelStyle == true){
      myStyleNames.push("Labels");
    return myStyleNames;
    function myMakeImageCatalog(myFiles, myNumberOfRows, myNumberOfColumns, myRemoveEmptyFrames, myFitProportional, myFitCenterContent, myFitFrameToContent, myHorizontalOffset, myVerticalOffset, myMakeLabels, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle,  myLayerName){
    var myPage, myFile, myCounter, myX1, myY1, myX2, myY2, myRectangle, myLabelStyle, myLabelLayer;
    var myParagraphStyle, myError;
    var myFramesPerPage = myNumberOfRows * myNumberOfColumns; 
    var myDocument = app.documents.add();
    myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
    myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
    var myDocumentPreferences = myDocument.documentPreferences; 
    var myNumberOfFrames = myFiles.length;
    var myNumberOfPages = Math.round(myNumberOfFrames / myFramesPerPage);
    if ((myNumberOfPages * myFramesPerPage) < myNumberOfFrames){ 
      myNumberOfPages++;
    //If myMakeLabels is true, then add the label style and layer if they do not already exist.
    if(myMakeLabels == true){
      try{
       myLabelLayer = myDocument.layers.item(myLayerName);
       //if the layer does not exist, trying to get the layer name will cause an error.
       myLabelLayer.name;
      catch (myError){
       myLabelLayer = myDocument.layers.add({name:myLayerName});
      //If the paragraph style does not exist, create it.
      try{
       myParagraphStyle = myDocument.paragraphStyles.item(myLabelStyle);
       myParagraphStyle.name;
      catch(myError){
       myDocument.paragraphStyles.add({name:myLabelStyle});
    myDocumentPreferences.pagesPerDocument = myNumberOfPages; 
    myDocumentPreferences.facingPages = false; 
    var myPage = myDocument.pages.item(0); 
    var myMarginPreferences = myPage.marginPreferences;
    var myLeftMargin = myMarginPreferences.left; 
    var myTopMargin = myMarginPreferences.top; 
    var myRightMargin = myMarginPreferences.right; 
    var myBottomMargin = myMarginPreferences.bottom; 
    var myLiveWidth = (myDocumentPreferences.pageWidth - (myLeftMargin + myRightMargin)) + myHorizontalOffset
    var myLiveHeight = myDocumentPreferences.pageHeight - (myTopMargin + myBottomMargin)
    var myColumnWidth = myLiveWidth / myNumberOfColumns
    var myFrameWidth = myColumnWidth - myHorizontalOffset
    var myRowHeight = (myLiveHeight / myNumberOfRows)
    var myFrameHeight = myRowHeight - myVerticalOffset
    var myPages = myDocument.pages;
    // Construct the frames in reverse order. Don't laugh--this will 
    // save us time later (when we place the graphics). 
    for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){ 
      myPage = myPages.item(myCounter);
      for (var myRowCounter = myNumberOfRows; myRowCounter >= 1; myRowCounter--){ 
       myY1 = myTopMargin + (myRowHeight * (myRowCounter-1));
       myY2 = myY1 + myFrameHeight;
       for (var myColumnCounter = myNumberOfColumns; myColumnCounter >= 1; myColumnCounter--){ 
        myX1 = myLeftMargin + (myColumnWidth * (myColumnCounter-1));
        myX2 = myX1 + myFrameWidth;
        myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")}); 
    // Because we constructed the frames in reverse order, rectangle 1 
    // is the first rectangle on page 1, so we can simply iterate through 
    // the rectangles, placing a file in each one in turn. myFiles = myFolder.Files; 
    for (myCounter = 0; myCounter < myNumberOfFrames; myCounter++){ 
      myFile = myFiles[myCounter]; 
      myRectangle = myDocument.rectangles.item(myCounter);
      myRectangle.place(File(myFile));
      myRectangle.label = myFile.fsName.toString();
      //Apply fitting options as specified.
      if(myFitProportional){
       myRectangle.fit(FitOptions.proportionally);
      if(myFitCenterContent){
       myRectangle.fit(FitOptions.centerContent);
      if(myFitFrameToContent){
       myRectangle.fit(FitOptions.frameToContent);
      //Add the label, if necessary.
      if(myMakeLabels == true){
       myAddLabel(myRectangle, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);
    if (myRemoveEmptyFrames == 1){ 
      for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){ 
       if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
        myDocument.rectangles.item(myCounter).remove();
       else{
        //As soon as you encounter a rectangle with content, exit the loop.
        break;
    //Function that adds the label.
    function myAddLabel(myFrame, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){
    var myDocument = app.documents.item(0);
    var myLabel;
    var myLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);
    var myLabelLayer = myDocument.layers.item(myLayerName);
    var myLink =myFrame.graphics.item(0).itemLink;
    //Label type defines the text that goes in the label.
    switch(myLabelType){
      //File name
      case 0:
       myLabel = myLink.name;
       break;
      //File path
      case 1:
       myLabel = myLink.filePath;
       break;
      //XMP description
      case 2:
       try{
        myLabel = myLink.linkXmp.description;
        if(myLabel.replace(/^\s*$/gi, "")==""){
         throw myError;
       catch(myError){
        myLabel = "No description available.";
       break;
      //XMP author
      case 3:
       try{
        myLabel = myLink.linkXmp.author
        if(myLabel.replace(/^\s*$/gi, "")==""){
         throw myError;
       catch(myError){
        myLabel = "No author available.";
       break;
    var myX1 = myFrame.geometricBounds[1];
    var myY1 = myFrame.geometricBounds[2] + myLabelOffset;
    var myX2 = myFrame.geometricBounds[3];
    var myY2 = myY1 + myLabelHeight;
    var myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel});
    myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset;
    myTextFrame.parentStory.texts.item(0).appliedParagraphStyle = myLabelStyle;   

    "Scripting Forum Conduct
    While this forum is a great place to get scripting help, it's also very easy to misuse it. Before using this forum, please read this post!"

  • Dynamic Structure creation and assigning data.

    Hi,
    I have a structure and a work area,
    DATA: begin of sample_struct,
          elem1 type xxx,
          elem2 type yyy,
          elem3 type zzz,
          end of sample_struct.
    DATA: wa_sample_struct type sample_struct.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    DATA: lt_comp       TYPE cl_abap_structdescr=>component_table.
    DATA: ls_comp       LIKE LINE OF lt_comp.
    DATA: l_index       TYPE string.
    DATA: lr_data       TYPE REF TO data.
    DATA: lr_table      TYPE REF TO
    I create a new structure at run time extending the sample_struct to add few more components at run time like this.
    lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data(wa_sample_struct).
        lt_comp = lr_rtti_struc->get_components( ).
    do 10 times.
          l_index = sy-index
          concatename 'element' l_index into ls_comp-name
          ls_comp-type = cl_abap_elemdescr=>get_string( ).
          APPEND ls_comp TO lt_comp.
    enddo.
    Then i create a work area of this new structure like this.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
        CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
        ASSIGN lr_data->* TO <fs_data>.
    Now <fs_data> is a work area for the structure.
    I can move the data in wa_sample_struct into <fs_data> like this.
    move-corresponding wa_sample_struct to <fs_data>.
    My problem is how do i access the dynamic components of this work area so that i can assign data to those components.
    If anybody knows how to access the dynamically added components of <fs_data> so that I can assgin data to those.
    Thanks in advance
    Sesh
    Message was edited by: Seshatalpasai Madala

    Hi,
          Looks like the problem is not well stated as I am getting answers which are not relevent.
    My existing structure.
    DATA: begin of sample_struct,
    elem1 type xxx,
    elem2 type yyy,
    elem3 type zzz,
    end of sample_struct.
    I create a new structure using this structure at runtime by adding new fields which are in a internal table. I add the new fields as follows.
    loop at it_tab into wa_tab.
    ls_comp-name = wa_tab.
    ls_comp-type = cl_abap_elemdescr=>get_string( ).
    APPEND ls_comp TO lt_comp.
    endloop.
    This internal table is built using the user input. So I dont know how many and what are the values in the internal table.
    LT_COMP has the existing structure field's as well as the newly added fields for my new structure.
    I create a new structure using this component list LT_COMP.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
    Now I have an object of cl_abap_structdescr. Which I can use as a data type for defining Workarea and internal table of this structure like this.
    CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
    ASSIGN lr_data->* TO <fs_data>.
    I can access all the existing fields of the strucutre like this.
    <fs_data>-elem1
    <fs_data>-elem2
    My problem is how do i access the newly added fields of the strucutre as I dont know the names of the fileds(I know them only at runtime).
    I hope I have explained it well enough, hope to see a relevent answer for the above problem.
    Thanks in advance.
    Sesh

  • How to get DIMENSION and CUBE data into JDeveloper???

    i have build cube and dimension using oracle analytical workspace manager (AWM),
    how i can get the cube and dimension data using jdeveloper 11gR2??
    does anybody know?
    any extension? or what??

    The simplest thing is to use JDBC (java.sql package) to access the cube and dimension views through SQL. Something like this (with appropriate error handling).
    String sql = "SELECT dim_key FROM product_view";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(sql);
    while (rs.next())
      // Process row here
    rs.close();
    statement.close();  If your requirements are more complicated or you feel adventurous, then you can use the Java OLAP API. This is the code used by the data viewer in AWM. (Look for olap_api.jar in your database installation -- olap\api\lib\olap_api.jar my windows instance.)

  • Dynamic radio button and retreving data

    Ineed help with this. On my JSP i dinammicaly create radio buttons.
    <c:forEach items="${ScoringTestForm.scCategoryRs.rows}" var="ctg" varStatus="statusCtg">
    <c:out value="${ctg.DESCR}" />
    <c:forEach items="${ctg.SCORINGITEM_RS.rows}" var="item" varStatus="statusItem">
    <c:out value="${item.LABEL}" />
    <c:forEach items="${item.SCORINGITEMVALUE_RS.rows}" var="itemVal" varStatus="statusItemVal">
    <c:set var="ivalcnt" value="${ivalcnt + 1}" />
    <input type="radio" id='rb<c:out value="${ivalcnt}" />' name='type<c:out value="${itemVal.IDSCITEM}"/>' value='<c:out value="${itemVal.VALUE}" />' >
    <label title='<c:out value="${item.LABEL}" />' for='rb<c:out value="${ivalcnt}"/>' ><c:out value="${itemVal.LABEL}" /></label>
    </c:forEach>
    </c:forEach>
    </c:forEach>
    this code creates multiple radio buttons with different names (type1, type2.....).How can i get the values from the radio buttons to my form bean. The radio buttons are populated from Rs objects witch contain Value objects. Thx

    @manjeet.patel,
    Just write the below line of code
    vbox1.validateNow();
    You need not use setTimeout() function
    vbox1.addChild(rb1);
    vbox1.addChild(rb2);
    vbox1.validateNow();
    Thanks,
    Bhasker

  • Day and Month date format - Calculating a measure only for the last day date format

    Good evening all,
    I'm really struggling with a MDX query and so would greatly appreciate your help ..
    Here is a simplified representation of my data:
    Id
    Tenor
    VarX
    1
    10-Jan-14
    10
    2
    10-Jan-14
    10
    3
    10-Jan-14
    10
    4
    11-Jan-14
    10
    5
    12-Jan-14
    10
    6
    13-Jan-14
    10
    7
    Feb-14
    10
    8
    Mar-14
    10
    9
    Apr-14
    10
    And here is the MDX result I’m trying to get:
    Tenor
    VarX
    VarY
    10-Jan-14
    30
    0
    11-Jan-14
    10
    0
    12-Jan-14
    10
    0
    13-Jan-14
    10
    90
    Feb-14
    10
    0
    Mar-14
    10
    0
    Apr-14
    10
    0
    Where: if tenor is the last tenor in day format (i.e. dd-mmm-yy) VarY = total sum of VarX else VarY = 0
    Here is a first try below which hopefully will help you understand my problem.
    MEMBER [Measures].[VarY] AS
    IIF (
    ISEMPTY([Measures].[VarX])
    OR vbamdx!Len([Tenor].CURRENTMEMBER.Name) <= 6 
    OR TAIL(
    FILTER(
    {[Tenor].[ALL].CHILDREN},
    NOT (ISEMPTY([Measures].[VarX])) AND vbamdx!Len([Tenor].CURRENTMEMBER.Name) > 6 
    ).ITEM(0).Name <> [Tenor].CURRENTMEMBER.Name,
    NULL,
    SUM ( [Tenor Group].[Tenor Group].[all], [Measures].[Delta] ) )
    Please let me know if you have any ideas and/or advice.
    Thanks in advance! Kevin

    Hey Aleksandr
    Tenor is a string. The tenor table is used by other reports too and contains tenors in day, month, etc format (e.g. 01-Jan-14, 02-Jan-14, 03-Jan-14, ..., Jan-14, Feb-14, ...).
    This is why I was trying to differentiate the 2 "groups" of tenor using length.
    Something like:
    MEMBER [MEASURES].[MOUT] AS 
    iif(
    isempty([Measures].[VarX]),
    null,
    iif(
    (Len([Tenor].CURRENTMEMBER.NEXTMEMBER.Name) =  
     Len([Tenor].CURRENTMEMBER.Name)
    null,
    SUM ( [Tenor].[all], [Measures].[VarX])))

  • SNP Planned order start and end dates are not calculated correctly

    Hello SNP Guru's
    The SNP planned orders generated after the Heuristics run, have a start and end date based on the Activity Duration (Fixed), while the resource consumption is based on the Bucket Consumption (Variable), which is correct.
    The Activity Duration (Fixed) is based on the BOM Base Quantity. So if the Activity Duration = 1 day, and if the order quantity is more than a day, the start and end dates, still shows as 1 day. So no matter what is the order quantity, the start and end dates is always = 1 day.
    Does anyone have any experience in implementing any code to change the start and end dates on SNP Planned Order?
    Seems like it should work as standard.
    Am i missing something?
    Thanks,
    Mangesh

    Dear Mangesh,
    SNP is a infinite planning tool. If you have defined fixed duration to be 1 DAY in the activity, no matter how many quantity you input for your planned order, the order will last for one day. If the resourced is overloaded, you then run capacity levelling to
    banlance the capacity. What your expected beahavior happens in PPDS planning.
    Claire

  • Contract Start and End Dates in Sales Order

    Hi
    I have a situation where a service item is bundled with a deliverable item. The order is as follows
    Line Item    Mat                                                                 Qty            Higher Level Item               
    10              Item No.1 (Physical Item)                                  1             
    20              Item No.2 (Service Item)                                    1               10
    For the deliverable item 10 , Revenue is recognized immediately. For the Service item no.20 , revenue needs to be recognized over a period of 1 Year (It is a 1 year service contract).
    The whole order is created via BAPI from an external 3rd party order capture system.
    In order to do revenue recognition properly for service items , SAP I believe has 2 options
    1. Based on Billing plan dates
    2. Based on contract start dates
    Since order with both the line items need to produce 1 invoice, I cannot use billing plan . The only other option is to use contract start and end dates. I have enabled contract data at the sales order level. So when I enter the contract start and end dates manually at the line item level and set the item category to recognize revenue based on contract start and end dates based on time-based revenue recognition it is working fine.
    But I need a way to automate the population of contract start and end dates at the line item level. My ABAP guy is not able to find a user exit that can change the XVEDA or any VEDA structure in any of the user exits.
    I guess the SAP SD gurus out there would have definitely dealt with a situation of product bundling (Service and non-service items in the same sales order with one billing document , but seperate revenue recognition for service and non-service items)
    Please help.
    Thnx
    Siva

    Hi Siva,
    Kindly let me know what criteria you want to give for automatic population of start date of contract...
    Standard SAP comes with a few baseline dates for contract start date and we can control this from customization itself. 
    01     Today's date
    02     Contract start date
    04     Acceptance date
    05     Installation date
    06     Date contract signed
    07     Billing date/Invoice date
    08     CntrctStDate+contract duration
    09     Contract end date
    If you have some criteria which is not covered here, then let me know and i will try to provide some help then.
    Thanks
    Kapil Sharma

  • How to get month last date and first date without FM's

    Hi Guru's,
       How can we get  month's first date and last date based on the date given in selection screen without FM's?Is it possible ?
    Like if i give 05-Oct-2008 in the selection screen, i should get the output as 01-Oct-2008 to 31-Oct-2008.Without FM's???
    Regards
    Rakesh.

    Hi Rakesh,
    You can implement this logic as follows:
    You can have two internal tables, one containing the days as numbered 31, 28, 31, and so on with the month number. This holds good if the year is a common year. Another internal table contains days as numbered 31, 29, 31 and so on with the month number. This year would be a leap year.
    An year can be calculated depending on the conditions:
    Say date is given as 20081008
    Concatenate 20081001 + 0(4) into l_date.
    Divide l_date by 4 and remainder should be equal to 0.
    Divide l_date by 400 and remainder should also be equal to 0.
    Then the dominical year will be a leap year.
    Now, if l_date divided by 100 and the remainder is 0 then the year is a common year.
    So depending on this populate the first date and last date from the respective internal table
    Regards,
    Sumalatha N.

  • Summary Vs. Aggregate Data

    Hi,
    Could anyone tell me the difference between summary and aggregate data?
    Thanks in advance,
    AJ

    yes.
    http://books.google.com/books?id=aIs8drBVdaoC&pg=PA355&dq=%22Before+you+can+query+SSAS+from+your+web+application%22&hl=en&sa=X&ei=z_HUUtD2L4juoASzuYGIBw&ved=0CEgQ6AEwAA#v=onepage&q=%22Before%20you%20can%20query%20SSAS%20from%20your%20web%20application%22&f=false
    Tatyana Yakushev [PredixionSoftware.com]
    Download Predixion Insight 3.0 - World class predictive platform for big data

  • Hyperion Planning dynamic forms based on start and end date across years

    Hi All,
    I have a requirement where i need to be able to view a form showing periods across years that are dynamically built depending on the start and end dates. If i have a start date of 01/11/2009 and an end date of 31/7/2013 i want to be able to view a form that shows all of the periods (Jan,Feb etc) in a form that is driven by these dates, in addition it will need to show the actual scenario up to the current month and the forecast from the current month to the end date. So basically if a user inputs the start and end dates the form will display the relevant periods driven by these dates.
    Any tips very much appreciated!

    Hello,
    This is difficult to realize, but you can get quite far with a workaround. The first question is, where do you want to input your selection of time periods? Assuming you have a webform with the complete timeline in months and years and you type in the start period and end period.
    Webforms have the option to suppress rows and columns.
    This can be extended with option of empty cells or not empty cells.
    You will need to apply your creativity on this.
    Put every month-year combination in a column and add the suppression.
    Calculate the timeline between start period and end period with a dummy member, so data exists for these and columns will show.
    Maybe you will need to copy the required timeline into a separate version for this, to avoid having periods which were outside the selection and still have data.
    I hope these hints help a bit in this challenge.
    Regards,
    Philip Hulsebosch
    www.trexco.nl

  • Date Based Dynamic Member Calculation Performance (MTD, YTD, PeriodsToDate)

    I'm working on an SSAS 2012 cube and I have defined several dynamic calculations based on a Date (MTD, YTD, TD, Thru Previous Month, etc.).
    The cube has a well defined Date dimension and I have set up a DYNAMIC calculated set in the cube as shown below.
    CREATE DYNAMIC SET CURRENTCUBE.[Latest Date]
    AS TAIL(EXISTS([Payment Date].[Calendar Date].[Date].Members,[Payment Date].[Calendar Date].CURRENTMEMBER,"Claim Payment"));
    ... and here is an example of one of my calculations.
    CREATE MEMBER CURRENTCUBE.[Measures].[Face Amount Paid MTD]
    AS SUM(MTD([Latest Date].ITEM(0).ITEM(0)), [Measures].[Face Amount Paid]),
    FORMAT_STRING = "$#,##0.00;-$#,##0.00",
    //NON_EMPTY_BEHAVIOR = { [Claim Payment Fact Count] },
    VISIBLE = 1 , DISPLAY_FOLDER = 'Face Amount' , ASSOCIATED_MEASURE_GROUP = 'Claim Payment';
    This calculation returns the correct results, but performs horribly.  I've noticed that changing the [Latest Date] set to STATIC, performance greatly improves, but numbers are no longer accurate as they are based on the Tail of the Claim Payment measure
    group without considering the filtered dates.  This is because the date is evaluated at process time, but needs to be based on users date selection to be accurate.  Therefore, STATIC does not appear to be an option.  Is there a better way to
    perform this calculation dynamically based on the filtered or unfiltered date dimension?

    Typically I would just do YTD/MTD/etc off the date the user has selected.  It seems like you want to do it based on the last date with data within the range they have selected.  Why not just give the user what they are asking for?
    In other words, why not
    YTD([Payment Date].[Calendar Date].currentmember)

Maybe you are looking for

  • Payment guarantee procedure key in customer master

    Hi , System determines payment guarantee procedure by 1. key for doc guarantee proc from sales doc type 2. customer payment guarantee procedure key in customer master However , I am not able to find the field in XD02 for maintaining cust payment guar

  • Missing receiver agreement for incoming IDoc

    Hi guys, I transfer IDoc's from a SAP-system to XI to start a ccBPM-process For that I don't need a receiver agreement. But why I get always the error message "<b>No receiver agreement found for sender -<SAP-SYSTEM> to receiver -<integration process>

  • Photo on iPhone won't send to Web Gallery

    HELP! I have iLife 08 and I have my .Mac email set up on my iPhone, but when I want to send to the web gallery, it won't let me! It says to check my password or username. I get email on my iPhone from .Mac which is the same password... what do I need

  • All text is auto-bulleting

    First post ever and a lame one at that. In trying to "educate" myself via a lynda.com online training video for "advanced" users re: tweaking preferences I have set something that is causing every entry of new text in CS4 on new documents to auto-bul

  • Regarding Netweer Installation

    pls any one can provide NetWeaver installation process as iam very new to this product thanks