8 Replies Latest reply on Aug 21, 2018 12:02 AM by Yvonne Cheng

# Data Grouping

I have a set of data of air tickets including from city and to city. Currently Singapore(from city) to California(to city) and California(from city) to Singapore(to city) are considered 2 records.

How to group them together? I would like to analyze air fare between 2 cities regardless of departure or arrival.

Pls find attached data sample.

Thanks for help in advance.

Yvonne

• ###### 1. Re: Data Grouping

Hi Yvonne,

Will creating combined fields and then grouping solve it for you? Please check attached file and let me know.

Thanks,

Vivek

• ###### 2. Re: Data Grouping

Hi Vivek,

My version is tableau 10.5. I can not open the workbook you attached.

But I tried the way you suggested. It is not easy for me when it include hundreds of from and to cities. Sample is just a few records of data.

Possible to create calculated field to do the job?

Best Regards

Yvonne

• ###### 3. Re: Data Grouping

Hi Yvonne,

Please check this attached file and let me know if this is what you are looking for.

Regards,

Vivek

• ###### 4. Re: Data Grouping

Hi Vivek,

I am not able to find attachment. Appreciate you could attach again, thanks.

Best Regards,

Yvonne

• ###### 5. Re: Data Grouping

Hi Yvonne,

The attachment is there in the previous post. Attaching again to this post.

Thanks,

Vivek

1 of 1 people found this helpful
• ###### 6. Re: Data Grouping

Hi Vivek,

This is correct!!  Appreciate  you could explain the logic of Max function. Thank you very much

Yvonne

• ###### 7. Re: Data Grouping

Hi Yvonne,

Refer: String Functions

Returns the maximum of `a` and `b` (which must be of the same type). This function is usually used to compare numbers, but also works on strings. With strings, `MAX` finds the value that is highest in the sort sequence defined by the database for that column. It returns `Null` if either argument is `Null`.

Example:

`MAX ("Apple","Banana") = "Banana"`

• ###### 8. Re: Data Grouping

Hi Vivek,

This is new to me. Thanks for sharing.