태블로 UDT 4기 day10

TIL, Today I Learn
총 복습

[DAY 10] 비즈니스 질문 해결하기

태블로 UDT 4기 day9

TIL, Today I Learn
테이블 계산식에 대해 배움

[DAY 9] 집합은 분석 앞으로 집합 - 과제

[1] 전체 매출 순위 vs 특정 지역 매출 순위

[2] 장바구니 & 교차판매 분석

태블로 UDT 4기 day8

TIL, Today I Learn
테이블 계산식에 대해 배움

[DAY 8] 공간의 지배자 - 과제

[1] 맵 이중축 + 맵 배경 커스텀 + AREA 함수 실습

[2] 맵 다중 레이어 실습나열하기

태블로 UDT 4기 day6~7

TIL, Today I Learn
테이블 계산식에 대해 배움

[DAY 6 - 7] 테이블 계산식 - 과제

[1] 테이블 계산식을 이용한 성장률 계산

[2] 제품 대분류별 매출 기준 상위 10개 제품 나열하기

[3] 파레토차트와 움직이는 참조선 그리기

태블로 UDT 4기 day3~5

TIL, Today I Learn
LoD에 대한 이해도가 높아짐

[DAY 3 - 5] 차원의 지배자1 LoD - 과제

[1] Fixed로 빈 행 채우기

[2] 시트 제목에 기간 명시하기

[3] 키워드 분석

3-1. 상위 10개 키워드

3-2. 순위 급상승 키워드

[4] 올해 vs 작년 기준 고객별 평균주문단가 구해서 증감율 구하기

태블로 UDT 4기 day1~2

TIL, Today I Learn
날짜함수 사용법에 대해 배움

[DAY 1 - 2] 시간의 지배자 - 과제

[1] 특정 날짜 기준으로 기준 월 vs 전 월 매출 비교

1-1. DATEPART 함수 사용하기

1-2. DATETRUNC, DATEADD 함수 사용하기

1-3. DATEDIFF 사용하기

[2] 특정 날짜 기준 MTD, 전년도 MTD

[3] 특정 날짜 기준 YTD, 전년도 YTD

[4] 전년 동기 대비 증감율 (YoY) 구하기

[번외] 달력에 수익률 표현하기

Tableau Embedding

Tableau Server에서 설정

Tableau Embedding API Version 2

Tableau Embedding API Version 3

tsm(Tableau Server Manager)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cd /opt/tableau/tableau_server/
tsm configuration get -k gateway.public.host
#server.tableau.com
tsm configuration get -k gateway.trusted
#127.0.0.1, 127.0.0.2
tsm configuration get -k gateway.trusted_hosts
#server.tableau.com
tsm configuration get -k gateway.public.port
#443

tsm configuration get -k vizportal.rest_api.cors.enabled
#true
tsm configuration get -k vizportal.rest_api.cors.allow_origin
#https://127.0.0.1 https://server.tableau.com, https://127.0.0.2, https://web.tableau.com
tsm configuration get -k wgserver.unrestricted_ticket
#true
tsm configuration get -k wgserver.clickjack_defense.enabled
#false
tsm configuration get -k vizportal.oauth.external_authorization_server.max_expiration_period_in_minutes
#600

tsm pending-changes apply

Window

  1. hosts 파일 우클릭 > Code(으)로 열기 > 수정 > 저장 > “Failed to save ‘hosts’: Insufficient permissions.
  2. Select ‘Retry as Admin’ to retry as administrator.”라는 알림창이 뜨면 [Retry as Admin…] 클릭 > Windows 명령 처리기 [예] 클릭
C:\Windows\System32\drivers\etc\hosts
1
2
127.0.0.1 server.tableau.com
127.0.0.2 web.tableau.com

Mac

Mac(iterm, terminal)
1
2
3
4
5
6
sudo vim /private/etc/hosts #i

127.0.0.1 server.tableau.com
127.0.0.2 web.tableau.com

# :wq

*.tableau.com로 Domain 맞춰서 SameSite Error 해결

Python, Java, JavaScript로 구현

token이 제대로 됐는지 https://jwt.io/에서 확인

JSONWebToken.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import jwt
token = jwt.encode(
{
"iss": connectedAppClientId,
"exp": datetime.datetime.utcnow() + datetime.timedelta(minutes=5),
"jti": str(uuid.uuid4()),
"aud": "tableau",
"sub": user,
"scp": ["tableau:views:embed", "tableau:metrics:embed"]
},
connectedAppSecretKey,
algorithm = "HS256",
headers = {
'kid': connectedAppSecretId,
'iss': connectedAppClientId
}
)
JSONWebToken.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.*;
import com.nimbusds.jwt.*;

import java.util.*;

...

String secret = "secretvalue";
String kid = "connectedAppSecretId";
String clientId = "connectedAppClientId";
List<String> scopes = new
ArrayList<>(Arrays.asList("tableau:views:embed"));
String username = "username";
JWSSigner signer = new MACSigner(secret);
JWSHeader header = new
JWSHeader.Builder(JWSAlgorithm.HS256).keyID(kid).customParam("iss", clientId).build();
JWTClaimsSet claimsSet = new JWTClaimsSet.Builder()
.issuer(clientId)
.expirationTime(new Date(new Date().getTime() + 60 * 1000)) //expires in 1 minute
.jwtID(UUID.randomUUID().toString())
.audience("tableau")
.subject(username)
.claim("scp", scopes)
.build();
SignedJWT signedJWT = new SignedJWT(header, claimsSet);
signedJWT.sign(signer);
model.addAttribute("token", signedJWT.serialize());
nest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { v4 as uuid } from 'uuid';
import * as config from 'config';

const tableauConfig = config.get('tableau');

@Injectable()
export class TableauService {
constructor(private jwtService: JwtService) {}

async getTableauToken(username: string){
const token = await this.jwtService.sign(
{
iss: tableauConfig.connectedAppClientId,
aud: 'tableau',
jti: uuid(),
sub: username,
scp: [
'tableau:view:embed',
'tableau:views:embed_authoring',
],
},
{
header: {
alg: 'HS256',
kid: tableauConfig.connectedAppSecretId,
iss: tableauConfig.connectedAppClientId,
},
secret: tableauConfig.secretvalue,
expiresIn: '5m',
},
);
return token;
}
}

태블로-신병훈련소-17기-day8

TIL, Today I Learn
집합을 만들 수 있음, 워크시트 또는 대시보드에서 동작을 만들 수 있음

set Action

매개변수를 이용한 드릴 다운