Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table, which have depature and arrivel Information. When I choose city A to city B in Dimension. The information of B to A will be also back.
I need pairwise comparition. Like this,
From | to |
A | B |
B | A |
B | A |
A | C |
C | A |
How can I write Expression?
ps. Dimension
From | To | Route | kilometer |
---|---|---|---|
A | B | A-B | 100 |
A | C | A-C | 150 |
B | A | B-A | 200 |
C | A | C-A | 250 |
So when you select A and B, you would also want to see B to A?
Can you share some data ?
Also, why is A-B and B-A different distances ? (also A->C and C->A different)
Are you attempting to accumulate the distances (round trip) or are they just vastly different routes being taken for reverse journeys?
Hi,
Is this what you are looking for?
The expression I used was:
Thank you very much. And more, I have ein Problem in Ranking. I want to first make a ranking, then show the top 3 route and their back way. what can I do the Ranking, in Dimension or in Expression?
Top 3
C-A 250
B-A 200
A-C 150.
And their back way ,
C-A 250
A-C 150
B-A 200
A-B 100
A-C 150
C-A 250 hier don't show, because this is duplicated.
My suggestion would be to rank the routes by kilometer in the load script:
So it becomes a dimension and easy to deal with. And then put a dimension filter to show only the top 3 routes based on kilometers:
Now, you are only showing the top 3 routes:
When you choose a different combo, you are still keeping the ranking and showing the back route of the chose combo:
Hope this helps.
Thanks Sinon.
You are welcome.
Hi, Happy new year!
I have another question. When I use only function, I don't change script. How can I caculate the summe of two directions.
For exaple, sum(A-B and B-A).
Thank you very much.