Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a dataset containing information on airport departures and arrivals.
airport | sens | country | Value |
A | Arrival | France | 3 |
A | Arrival | Allemagne | 8 |
A | Departures | France | 10 |
A | Departures | Italie | 3 |
B | Arrival | France | 3 |
B | Arrival | France | 3 |
B | Arrival | Allemagne | 8 |
B | Departures | France | 10 |
B | Departures | Italie | 3 |
B | Arrival | France | 3 |
Is it possible to create a chart like this: P is a country, A is a aeroport name. On the right we have arrivals and on the left we have departures
Like this
main:
load * inline
[airport,sens,country,value
A,Arrival,France,3
A,Arrival,Allemagne,8
A,Departures,France,10
A,Departures,Italie,3
B,Arrival,France,3
B,Arrival,France,3
B,Arrival,Allemagne,8
B,Departures,France,10
B,Departures,Italie,3
B,Arrival,France,3];
Network:
Load distinct autonumber(Label)-1 as Key,*;
Load airport as Label, 'Airport' as Group Resident main;
mapAirport:
Mapping Load Label, Key Resident Network;
Concatenate(Network)
Load
RowNo()-1 as Key
,country as Label
,sens as Group
,value as SegmentValue
,ApplyMap('mapAirport',airport,null()) as Parent
Resident main;
With the network chart (if you modify your dataset, as is, it can not work), you will not be able to decide what should be displayed on the right or on the left.
However, with a Sankey chart, maybe you can achieve something close to your need.
You will need to change your dataset in order to have one table for the arrivals and one table for the departures, so you can use the dimensions departure_country, airport and arrival_country.
I tried the Sankey chart but my data is not evenly distributed. It's quite illegible.
How can i modify my dataset to make it compatible with the network graph ?
Look at the help section for the network chart, I think that this is well explained.
You need to build something like this:
Key | Label | Group | Value | Parent |
0 | A | airport | ||
1 | B | airport | ||
2 | France | arrival | 3 | 0 |
3 | Allemagne | arrival | 8 | 0 |
4 | France | departure | 10 | 0 |
5 | Italie | departure | 3 | 0 |
6 | France | arrival | 3 | 1 |
7 | France | arrival | 3 | 1 |
8 | Allemagne | arrival | 8 | 1 |
9 | France | departure | 10 | 1 |
10 | Italie | departure | 3 | 1 |
11 | France | arrival | 3 | 1 |
Hello,
In script i have my first table *main* and i add a new table networktable for network chart. I don't understand where should I put the code (`Autonumber("Label") as Key`) to create the 'key' column
main:
LOAD
sens,
airport,
Autonumber("airport") as airportID,
Country
FROM [...]
(qvd);
networktable:
LOAD
Distinct(aeroport) as Label,
'airport' as Group
RESIDENT main;
CONCATENATE (networktable)
LOAD
Country as Label,
sens as Group,
aeroportID as Parent,
Value
RESIDENT main;
Concatenate (networktable)
Like this
main:
load * inline
[airport,sens,country,value
A,Arrival,France,3
A,Arrival,Allemagne,8
A,Departures,France,10
A,Departures,Italie,3
B,Arrival,France,3
B,Arrival,France,3
B,Arrival,Allemagne,8
B,Departures,France,10
B,Departures,Italie,3
B,Arrival,France,3];
Network:
Load distinct autonumber(Label)-1 as Key,*;
Load airport as Label, 'Airport' as Group Resident main;
mapAirport:
Mapping Load Label, Key Resident Network;
Concatenate(Network)
Load
RowNo()-1 as Key
,country as Label
,sens as Group
,value as SegmentValue
,ApplyMap('mapAirport',airport,null()) as Parent
Resident main;
Hello,
On the graph I have a relationship for each row in my table. I want to group the data by airport, direction, country and sum(value). I thought I should just add this code after the table main.
main: ...
aggregateData:
Load sens
,sum(value) as value,
,airport
,Country
Resident main
Group By sens, airport, Country;
i get a $Syn table and aggregate table with only sum(value) data