Skip to main content

Hi all,

 

I have seen most of the discussions related to Sankey Diagram in the forum and elsewhere. 

 

Have a question on the same -

Can we build Sankey Diagram to show the flow of count of id's from one 'Region'  to  'Counties' in that region.  I tried to use count but then I am facing an error when I try to write a calculation for

the 'pad' variable.

 

COUNT(if ([id]) = { FIXED [Region],[County]: MIN([id])} then 1 ELSE 49 END) this does not make sense.

 

For the examples that are shown the variable chosen is for example sales - which is a measure and it makes sense.

 

Can I get some advise if I can build a Sankey for my situation, ie. to show how the count of id's in a 'Region' get distributed over the 'County' in that region.

If not can you advise a chart type that I can use.

 

Thanking you all

 

Regards,

RS

2 个回答
  1. 2022年3月23日 16:27

    When working with record counts in a Sankey diagram, I substitute a Count function wherever you would typically use a Sum function. My field calculations based upon Art of Visualization's very helpful video are below.

     

    // VizSide

    if [Table Name]="Orders" then "Region" else "Segment" end

     

    // ToPad (SET TO DISCRETE BEFORE CREATING PADDING)

    if [VizSide]="Region" then 1 else 49 end

     

    // Padding - Right-click ToPad and select "Create bins," size: 1

     

    // t

    (INDEX()-25)/4

     

    // Rank 1

    RUNNING_SUM(COUNT([Orders]))/TOTAL(COUNT([Orders]))

     

    // Rank 2

    RUNNING_SUM(COUNT([Orders]))/TOTAL(COUNT([Orders]))

     

    // Sigmoid

    1/(1+EXP(1)^-[t])

     

    // Curve

    [Rank 1]+(([Rank 2]-[Rank 1])*[Sigmoid])

     

    // Field sizing

    WINDOW_AVG(COUNT([Orders]))

     

    // Tooltip percentage

    ([Field sizing]/TOTAL(COUNT([Orders])))*2

0/9000