Macro for copy values from one object and szenario to another

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Macro for copy values from one object and szenario to another

    Hello,

    I need a help with macro.
    I have a Report in Jedox Web. It is posible to choose object and szenario. For this object and szenario user can write values. After than it is posible to copy all values from this object and szenario to another object and szenario:
    object1 and szenario1 copy to object2 and szenario2.
    At the moment it is realized with ETL Job, but I need to do this with macro.
    Cube have 5 dimensions:
    Dim1
    Dim_Object (variable - combobox)
    Dim_Szenario (variable combobox)
    Dim4
    Dim5

    I need to get values for all Elements in Dimensions: Dim1, Dim4 and Dim5 for SourceObj with SourceSz
    and than send they to Dim1, Dim4, Dim5 with TargetObj and TargetSz

    $as = activesheet();
    $SourceObj = retrieve_variable("v_SourceObj");
    $SourceSz = retrieve_variable("v_SourceSz");
    $TargetObj = retrieve_variable("v_TargetObj");
    $TargetSz = retrieve_variable("v_TargetSz");
    $DB = activeworkbook()->names->item('DB')->value;
    $Cube = 'Cube';

    I can get one value and copy it:
    $Value = application()->palo_data($DB, $Cube, Dim1, $SourceObj, $SourceSz, Dim4, Dim5);
    application()->PALO_SETDATA($Value, 'TRUE', $DB, $Cube, , Dim1, $TargetObj, $TargetSz, Dim4, Dim5);

    How can I get and send all values? Any ideas?

    I'm starter with Jedox and Macros. Thanks in advanced for your help.

    Best regards,
    Sigita
  • Hi laloune,

    thanks for Your responce. I found another way to do it without building an array. I used copy statement and send it to the database. So i copy all elements:


    $Copy1 = 'copy "'.$SourceObj.'";"'.$SourceSz.'";Kopiersumme withrules';
    application()->PALO_SETDATA($Copy1, 'TRUE', $DB, $Cube1, $TargetObj, $TargetSz, 'Kopiersumme');
  • New

    You know, you can use copy/like feature in macro as well. For example - how I copy values from previous year to current via macro:

    PHP Source Code

    1. $prev_year = $year - 1;
    2. $actual_py = application()->palo_data($server, $cube, $prev_year, 'All companies', 'actual');
    3. application()->PALO_SETDATA($actual_py.' like actual;'.$prev_year,TRUE,$server,$cube,$year,'All companies','actual');
    Where