grouping dimension values

    Hi community,

     

    to enable users to group dimension values into newly defined groups in order to perform analytics on this groups, I created this test application.

     

    hope it might be of any use

     

    regards

     

    Marco

     

     

    Suppose there is a "number" field which we want to group into different categories.

    We add an input box bound to the variable vGroupName,

    a Listbox "groupName" to select the different groups of numbers,

    a table that shows what numbers belong to which group,

    two charts that visualize the numbers and sums of the numbers by group

    and a magic "new group of numbers" button that calls this vbs macro:

     

    sub MakeGroup

      ActiveDocument.DynamicUpdateCommand("DELETE FROM tabGroups WHERE groupName = '$(vGroupName)'")

      for i = 1 to ActiveDocument.Evaluate("=getSelectedCount(number)")

      InsertValue = ActiveDocument.Evaluate("=subfield(getFieldSelections(number, ';'), ';' ,"&i&")")

      ActiveDocument.DynamicUpdateCommand("INSERT INTO tabGroups (groupName, number) VALUES ($(vGroupName), "&InsertValue&")")

      next

    end sub

     

    This macro populates the tabGroups table with a group name and the selected numbers.

    We initiate the application using e.g. this script:

     

    tabNumbers:

    LOAD

      RowNo() as number

    AutoGenerate 10;

     

    tabGroups:

    LOAD

      'one' as groupName,

      1 as number

    AutoGenerate 1;

     

    The result would look like this:

     

    QlikCommunity_Thread_110794_Pic6.JPG.jpg

     

    QlikCommunity_Thread_110794_Pic2.JPG.jpg

     

    You then could select some numbers, enter a group name in the input box and press the "new group of numbers" button, which creates a new group consisting of your selected numbers and named as you entered in the input box.

     

    QlikCommunity_Thread_110794_Pic3.JPG.jpg

     

    QlikCommunity_Thread_110794_Pic4.JPG.jpg

     

    QlikCommunity_Thread_110794_Pic7.JPG.jpg

     

    This solution only works, if you can enable the dynamic update feature

    QlikCommunity_Thread_110794_Pic5.JPG.jpg

    on document as well as on server level and might be limited to the IE plugin due to the AJAX/macro issue.