1 Reply Latest reply: Apr 1, 2017 4:08 AM by Gysbert Wassenaar RSS

    Sankey Diagram, handling nulls

    Brian MacDonald

      I am trying to develop a Sankey diagram in QlikSense for patient flow in a clinical trial.  I am using the extension here.

       

      Here is a sample of my data.  This data does not work

      MySankeyData:

      LOAD * INLINE [

      'Node1','Node2','Node3','MyCount'

      'Screened','Enrolled','Completed','4'

      'Screened','Enrolled','Discontinued','1'

      'Screened','Enrolled','','1'

      'Screened','','Failed','2'

      ];

       

      The subject in the third line is still active and so I can easily enough enter 'Active' in node 3.  But I cannot handle the null in the fourth line.  I can transform the data to this....

      MySankeyData:

      LOAD * INLINE [

      'Node1','Node2','Node3','MyCount'

      'Screened','Enrolled','Completed','4'

      'Screened','Enrolled','Discontinued','1'

      'Screened','Enrolled','Active','1'

      'Screened','null','Failed','2'

      ];

       

      And this gives me the following diagram...

      sankey.jpg

      But the term 'null' in node 2 is obviously not what I want.

       

      I have tried:

      'Screened','','Failed','2'

      'Screened',,'Failed','2'

      'Screened','Failed','','2'  - (which would move the 'Failed' to the second node, not ideal but the diagram would have to terminate here to be meaningful and the null in node3 does not work)

      etc,


      So I am hoping someone can help me with how to handle the nulls.

       

      As an aside, the Sankey diagrams for QlikView seem to operate effortlessly from a concatenated path flow.  Witness this video from Dalton Reuer (skip to 2:34 in the video).  But the Sense apps seem to require each node defined as a dimension.  Why is this?  Is there something I am doing wrong in my data prep?


      Thanks in advance.



        • Re: Sankey Diagram, handling nulls
          Gysbert Wassenaar

          I'd replace the string 'null' with something like 'N/A' or 'unknown' or 'missing' or 'no data'. If you don't want that you can something like this:

           

          set NullInterpret =;

           

          MySankeyData:

          LOAD * INLINE [

          'Node1','Node2','Node3','MyCount'

          'Screened','Enrolled','Completed','4'

          'Screened','Enrolled','Discontinued','1'

          'Screened','Enrolled','','1'

          'Screened', ,'Failed','2'

          ];