You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/09/26 18:43:23 UTC

[GitHub] pajachiet commented on issue #3059: Cannot create sankey diagrams with more than two source/target dimensions

pajachiet commented on issue #3059: Cannot create sankey diagrams with more than two source/target dimensions
URL: https://github.com/apache/incubator-superset/issues/3059#issuecomment-332296194
 
 
   I encounter the same need, which is to do a Sankey Diagram from multiple source/target pairs in the same table. This is natural when "columns" that appear in the sankey diagram correspond to columns in a table. 
   
   In SQL, it can be done with UNION, but it is cumberome. Even more if you want to base other visualizations on the same datasource, as you have to dupplicate rows informations.
   
   For example if we want to represent how towns population regroup into states and countries, with a table ('country', 'state', 'town', 'population'), we would do
   ```
   SELECT    
       town as source, state as target, 
       country, state, town, population
   FROM your_table
   UNION
   SELECT 
      state as source, country as target, 
      country, state, town, population
   FROM your_table
   ```
   
   Would it be possible to do this union directly in the query generated for the visualization ?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services