2 Replies Latest reply: May 12, 2015 4:45 PM by Gabriel Oluwaseye RSS

    How to get the desired output?

    Vidit Saxena

      Hi,

       

      I have a input table with looks like the below.

       

      PlantTranscation count
      A2
      A;B10
      A;C;D12
      D5
      B8
      A;B;C;D17
      E1

       

      On the dashboard, i need to have a list box(Plant)

       

       

      Plant List Box
      A
      B
      C
      D
      E

      and a straightt table. Such that

        

        Output tables

      Straight table On A Value selection
      PlantTranscation count
      A2
      A;B10
      A;C;D12
      A;B;C;D17

       

      Straight table On D Value selection
      PlantTranscation count
      A;C;D12
      D5
      A;B;C;D17

       

       

      Straight table On E Value selection
      E1

       

      Please suggest

        • Re: How to get the desired output?
          Massimo Grossi

          a:

          load * inline [

          Plant, Transcation count

          A, 2

          A;B, 10

          A;C;D, 12

          D, 5

          B ,8

          A;B;C;D, 17

          E, 1

          ];

           

           

          b:

          load subfield(Plant, ';') as PlantListbox, Plant resident a;

           

          then add the PlantListbox listbox

           

          1.png

          • Re: How to get the desired output?
            Gabriel Oluwaseye

            Hi,

             

            Try this

             

            PlantGroup:

            LOAD * Inline [

            Plant,    Transcation count

            A,    2

            A;B;,    10

            A;C;D,    12

            D,    5

            B,    8

            A;B;C;D,    17

            E,    1

            ];

             

            PlantTable:

            LOAD

            SubField(Plant,';') AS PLANT

            Resident PlantGroup;

             

            LET NumOfGroups= NoOfRows('PlantTable');

             

             

            FOR i=0 to $(NumOfGroups)-1

             

            LET GroupVariable=peek('PLANT',$(i),'PlantTable');

            PlantGrouping:

            LOAD

            Plant,

            '$(GroupVariable)' as GroupPlant

            Resident PlantGroup

            where SubStringCount(Plant,'$(GroupVariable)')>0

            ;

            Next

            drop Table PlantTable;