Menu

How to calcualte the number of repeating elements within each group or subgroup in cube for a row axis

2013-08-11
2013-08-16
  • Massimo Mirabito

    Hello all

    I am really new to OLAP4J but I was wondering is there a quick away to figure out while looping through the row axis (axis.getPositions().size()) and its members the number of occurrence a member is repeated within.

    For example
    ----------------------------- CA --- FL------ NY
    G1 -> V1 -> BBBB.......1.........10........3
    G1 -> V1 -> CCCC.......0.........20........4
    G1 -> V2 -> AAAA.......5..........5........0
    G1 -> V2 -> BBBB......12..........6........0
    G1 -> V2 -> CCCC.......1..........0........0
    G1 -> V3 -> AAAA.......1..........0........0
    G2 -> V1 -> AAAA......10..........0........0
    G2 -> V1 -> BBBB.......1..........0........0
    G2 -> V1 -> CCCC.......2..........0........0
    G2 -> V2 -> AAAA.......7..........0........0
    G2 -> V2 -> BBBB.......0..........0........0

    If the output above is returned as above (beside having a convoluted set of loops) is there any way I could figure out using OLAP4J API that
    1) G1 is repeated 6 times
    2) G2 is repeated 5 times
    3) V1(G1) 2 times
    4) V2(G1) 3 times
    4) V3(G1) 1 time

    And this goes own for the entire cube result it's sort of like control break or grouping logic.

    Thanks in advance for any help

    max

     

Log in to post a comment.