8 Replies Latest reply: Jan 4, 2016 12:21 PM by M MinMin

# One way and back way data compare

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

FromToRoutekilometer
ABA-B100
ACA-C150
BAB-A200
CAC-A250
• ###### Re: One way and back way data compare

So when you select A and B, you would also want to see B to A?

• ###### Re: One way and back way data compare

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?

• ###### Re: One way and back way data compare

Hi,

Is this what you are looking for?

The expression I used was:

• ###### Re: One way and back way data compare

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.

• ###### Re: One way and back way data compare

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.

• ###### Re: One way and back way data compare

Thanks Sinon.

• ###### Re: One way and back way data compare

You are welcome.

• ###### Re: One way and back way data compare

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.