본문 바로가기
Tableau/Tableau Desktop Specialist

[Tableau] tableau desktop specialist 이론 정리 2

by Mr.Han 2024. 4. 28.

※ 본 포스팅은 'Udemy'의 'Tableau Desktop Specialist Certification Exam Prep 2024' 강의의 내용을 참고하여 요약함.

2. Connecting to and Preparing Data


2-1) Live vs Extracts

Live Connection

 

어떤 원본 데이터(csv, excel file 등...)를 Tableau에 연결한다면, Default는 Live Connection

- 일대일 연결

- 원본 데이터를 변경하면 Tableau propagate(전파)됨.

 

Extracts

 

Save subset of original data source

- 성능 향상

- 필터를 사용하여 전체 데이터 양을 줄일 수 있음.

- Refresh 가능.

    → Full refresh : replaces all of the contents in the extract

    → Incremental refresh : only add rows that are new since the previous refresh

 - Extracts의 장점

    → Supports large data sets

    → Help improve performance

    → Support additional functionality

    → Provide offline(local) access to your data 


2-2) Creating extracts

- Extract files의 확장자는 .hyper(default), .tde

- Data Source 페이지 우상단의 Connection > Extract 하면 생성됨. (추출한 시간 표시됨.)

- Sheet에서 Dataset 우클릭 > Use Extract

    → Extract > Properties로 속성 볼 수 있음.

     Live connection 상태에서 Extract Data 하면 추출 가능 (필터와 행 선택 가능)


2-3) Creating a live connection

- Server data, Cloud 사용할 떄 많이 활용됨.

- Data 연결하면 Live connection이 default


2-4) .tds & .tdsx extensions

- .tds, .tdsx 파일은 시각화를 포함하지 않음.

- Data > Data Source 이름 > Add to Saved Data Sources 에서 저장 가능

- Saved Data Sources에서 불러오기 가능

 

Data Source (.tds)

light datasource

contains only the information needed to connect to the data source (경로만 포함, 데이터 자체가 포함되지는 않음.) 

- Data source type

- Connection information : location of local files, tables

- Groups, sets, calculated fields, bins

- Default field properties : number formats, aggregation, sort order

 

Packaged Data Source (.tdsx)

heavy datasource

contains all information in the .tds file + copy of any local file-based data or extracts (원본 데이터 포함.)


2-5) .twb & .twbx extensions

- File > Save as 에서 저장 가능

 

Workbooks (.twb)

- 시각화 포함 가능

- 하나 이상의 worksheet, 0개 이상의 dashboard / stories를 포함한다.

- original data source의 copy는 포함하지 않음.(.tds와 같이 경로만)

 

Packaged Workbooks (.twbx)

- a single zip file that contains a workbook along with any supporting local file data and background images

- original data copy, visualization 포함 (everything)

- original data에 접근 권한이 없는 사람에게 공유할 때 가장 좋은 방법


2-6) Creating Joins

- Joins : 여러 테이블을 어떤 로직에 의해 결합하는 방법

- Tableau에서 사용 가능한 Join 방법 : inner, left, right, full outer

- 최대 32 tables 조인 가능

 

Inner Join

- contains values that have matches in both tables

- 선택한 fields를 기준으로 (보통 uniquely identified fields)

- 매칭되지 않으면 결과에 포함 X

- 기준 fields는 한 번만 출력

 

Left Join

- contains all values from the left table and corresponding matches from the right table (left table 보존)

- 기준 fields는 한 번만 출력

 

Right Join

- contains all values from the right table and corresponding matches from the left table (right table 보존)

- 기준 fields는 한 번만 출력

 

Full Outer Join

- contains all values from both tables (both table 보존)


2-7) Relationships

- 다수 테이블의 데이터를 결합하는 새로운 방법

- 같은 data type을 가져야 함.

- simply defines how two tables relate to each other but does not merge them together like a join 

    → 두 테이블이 어떻게 연결되어야 하는지만 정의하고(specified a contract), 물리적으로 merge 지는 않음.

    → 조인을 하면 새로운 테이블로 병되어 original tables에 대하여 쿼리 불가 (data source filter 사용이 가능하다는 장점이 있음.)

    → The tables remain distinct and maintain their own level of detail.

    → Tableau will decide the most appropriate join at run-time based on what fields you've dragged into the view.

 

- Data model has 2 layers

      Logical layer : combine data by using relationships (noodles)

      Physical layer : combine data bay using joins(ven diagram) and unions

 

- Relationships의 장점

    → No up-front join type

    → Automatic and context-aware

    → Flexible

- Orders 테이블을 더블클릭하면 physical layer의 구성을 알 수 있음. 

- 그 후 다른 테이블을 드래그하여  join 가능

 

https://help.tableau.com/current/public/desktop/en-us/datasource_relationships_learnmorepage.htm

- The resultant table after joins is called Logical Table A (linked to Logical Table B in some way)


2-8) Creating Unions

- combine two or more tables by appending values (rows) from one table to another

- Join은 Column의 수가 많아지고, Union은 Row의 수가 많아짐.

- Data Source 창에서 New Union을 드래그 > union 대상 테이블 드래그

    → Column명과 수가 같으면 자동으로 실행

- Wildcard search 기능을 이용해 특정 기준을 주면 자동적으로 table들을 찾아 union 가능

https://help.tableau.com/current/pro/desktop/en-us/union.htm


2-9) Creating Blends

- A method for combining data from multiple sources.

 

Join과의 다른점

- Join은 다수의 Sheet(Table) 간의 결합, Blend는 다수의 Data Source 간의 결합

- Join은 data 결합 후 집계 실행,  Blend는 집계 후 data 결합

 

 

- Multiple data sources가 있어야 Blend 가능(Primary data source, Secondary data source)

- 실제 blended data source가 출력 및 저장지는 않음.(Publish 불가) → 시각화로 확인 가능

- Blends는 항상 Left Join

- Field를 먼저 드래그해서 시각화한 Data source가 Primary data source

- Secondary data source의 이름이 비슷한 fields에 링크 표시가 생김.(Linking field)

→ 링크 표시를 눌러 blend할 fields 선택 가능

- Blended data의 view 내 asterisk(*)는 multiple values를 나타냄.


2-10) Renaming Fields

- Tableau에서 field 이름을 바꿔도 Original data source는 변경되지 않음.

- Field name = The name in Tableau

- Remote Field name = The name in the original data source

- Field 우클릭 > Describe > Remote column : Original field name 확인할 수 있음.

Field의 이름을 바꾸는 방법

1. Double click the field.(Data Source 창에서)

2. Field에 커서 올려놓고 ▼ 드다운 클릭 > Rename (Data Source 창에서)

3. Field 우클릭 > Rename (Sheet 창에서)


2-11) Creating Aliases

- Dimension에 대해서만 Aliases 생성 가능 (Measures는 불가)

- View에서 Field 내 Label이 Alias로 나타남.

- Field 우클릭 > Aliases > Value(Alias) 더블클릭 후 수정 (Data Source 창, Sheet 창에서 가능)

- 초기화는 Clear Aliases 

- Original data source는 변경되지 않음.