PHP: palo_datav()

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

  • PHP: palo_datav()

    Hi, have a small problem with the datav function.
    I want to get a view, but all what i get is a error message.

    If you need more informations then ask me please.

    Thanks for your help.

    Warning: PHPPalo error: Unknown exception in "Path..." on line 119

    f.I.: Line 119 is $aSlice = ...

    Source Code

    1. // Abfrage eines Datenslice
    2. $aCooDim1 = array("2004"); // Dim 1 - Jahre
    3. $aCooDim2 = array("Plan", "II. Abweichung"); // Dim 2 - Datenart
    4. $aCooDim3 = array("KWL", "LVB"); // Dim 3 - Firma
    5. $aCooDim4 = array("TEURO"); // Dim 4 - Einheit
    6. $aCooDim5 = array("Jahre"); // Dim 5 - Periode
    7. $aCooDim6 = array("UR UMSATZRENDITE"); // Dim 6 - Position
    8. $aSlice = palo_datav ($connection, $db, $cube, $aCooDim1, $aCooDim2, $aCooDim3, $aCooDim4, $aCooDim5, $aCooDim6);
    9. print_r($aSlice);
    Display All


    Greetings eXo
  • RE: PHP: palo_datav()

    Hi
    did you try it with the exmpale given in the doc:

    Example: $result = palo_datav("Test/DemO", "Sales", "All Products", array(5, 1, "Europe", "West", "East", "South", "North"), array(1, 5, "Year", "Qtr. 1", "Qtr. 2", "Qtr. 3", "Qtr. 4"), "2002", "Budget", "Units")?

    I think you can leave out Array() where only one Element is referenced.

    Greetings from Cologne
    Holger
  • Hi Holger,
    thx for your reply.

    No, i didn't test the demo. the only thing that i have done was to explode the example-function to check my function settings. i have checked my dimensions (to not forget a dim. ;-)).
    For the arrays that i used, i need them later in my endversion to enlarge the number of elements.

    But on Monday i think i will check the demo-function on work.

    cu later

    UPDATE: ok, the example is running.

    what are the colored numbers in front of the arrays?

    $result = palo_datav("Test/DemO",
    "Sales",
    "All Products",
    array(5, 1, "Europe", "West", "East", "South", "North"),
    array(1, 5, "Year", "Qtr. 1", "Qtr. 2", "Qtr. 3", "Qtr. 4"),
    "2002",
    "Budget",
    "Units")
    Greetings eXo ;)

    The post was edited 3 times, last by eXo ().

  • Hello,

    if I leave them out then comes an error like in my first query. I think, if I come behind the secret of these numbers then I could solve my problem(I hope, but I dont think so). But, if I change these number for example 1,5 and 5,1 then it will be change the axis of the table. And the result of 1,1 and 1,1 is one vertical line.

    Here comes this error for Dataslice #1: Element not found
    [PHP]
    // Abfrage eines Datenslice #1
    $aCooDim1 = array(3, 1, "2003", "2004", "2005"); // Dim 1 - Jahre
    $aCooDim2 = array(1, 3, "I. Abweichung", "II. Abweichung", "Abweichung in %"); // Dim 2 - Datenart
    $aCooDim3 = "KWL"; // Dim 3 - Firma
    $aCooDim4 = "TEURO"; // Dim 4 - Einheit
    $aCooDim5 = "Jahre"; // Dim 5 - Periode
    $aCooDim6 = "UR UMSATZRENDITE"; // Dim 6 - Position

    // Abfrage eines Datenslice #2
    $aCooDim1_demo = "All Products"; // Dim 1
    $aCooDim2_demo = array(5, 1 , "Europe", "West", "East", "South", "North"); // Dim 2
    $aCooDim3_demo = array(1, 5, "Year", "Qtr. 1", "Qtr. 2", "Qtr. 3", "Qtr. 4"); // Dim 3 - Firma
    $aCooDim4_demo = "2002"; // Dim 4
    $aCooDim5_demo = "Budget"; // Dim 5
    $aCooDim6_demo = "Units";
    [/PHP]
    Greetings eXo ;)
  • Hello eXo,

    The function datav() uses arrays as parameters to return the data.
    For each dimension the size has to be defined, for example:

    array([number of rows], [number of columns], value1, value2...)

    $result = palo_datav("localhost/Demo", "Sales", "All Products",
    array(5, 1, "Europe", "West", "East", "South", "North"), //heading of the rows
    array(1, 5, "Year", "Qtr. 1", "Qtr. 2", "Qtr. 3", "Qtr. 4"), // heading of the colum
    "2002", "Budget", "Units");

    See the result in attachment 1.

    This can also be interlaced:

    $result = palo_datav("localhost/Demo", "Sales", "All Products",
    array(1, 1, "Europe"),
    array(1, 5, "Year", "Qtr. 1", "Qtr. 2", "Qtr. 3", "Qtr. 4"),
    array(1,1,"2002"),
    "Budget",
    array(1,10,"Units","","","","", "Gross Profit","","","",""));

    As Holger already mentioned. Instead of array(1, 1, "Europe") you can also
    write only "Europe".

    See the result in attachment 2.

    For a better understanding go to Excel and paste this view by using the
    DATAV function. If you go to the cell right to "Units" you see an empty string
    in the cell. The values are all fetched by this formula defining the array:

    {=PALO.DATAV("localhost/Demo";"Sales";"All Products";"Europe";
    "Year":"Qtr. 4";"2002";"Budget";"Units":"")}

    So far to datav().


    Here comes this error for Dataslice #1: Element not found


    It looks like the element of this dataslice is not there.
    - Have you solved your problem yet?

    Regards,
    Stephanie
    Images
    • datav1.gif

      6.18 kB, 599×220, viewed 1,083 times