묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Vue 3 & Firebase 10 커뮤니티 만들기 풀스택 - "활용편" (with Pinia, Quasar, Tiptap, VueUse)
건의사항
짐 코딩님 강의 정말 잘 보고 있습니다.강의 내용과 별도로 좋았던게 문서보는법이였는데요. 해당 부분 추후 강의에서 좀 더 다뤄주셨으면 좋을것 같아서요.제가 아직 강의를 다 수강한건 아니지만 FireBase 문서 뿐만 아니라 다른 프레임워크 문서, 라이브러리 문서, 기타 서비스 문서 보는 법과스택오버플로우 문서활용하는 법 (에러 내용은 같지만, 에러 발생한 및 개발하는 상황이 다른경우가 많더라구요)다른 사람들이 GitHub 코드 참고 및 활용하는 방법도 영상으로 꼭 다뤄주셨으면 좋겠습니다..! 추가로 FireBase 강의의 경우 DB 관리및 설계를 FireBase 를 활용해서 하였는데순수하게 백엔드 및 DB 설계하는 강의도 꼭 다뤄주시면 진짜 반드시 수강신청해서 완강하겠습니다..! 좋은 강의 올려주셔서 감사합니다
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
로그인 로그아웃
강의 잘 보고 있습니다다름이 아니라 로그인 로그아웃 버튼도 만들었고수업에 나온 것처럼 똑같이 코드를 썼는데도막상 작동하면 uid까진 출력되는데문제는1) 로그아웃 버튼을 누르면 null 메세지가 출력이 안 됩니다2) 그렇다고 로그아웃 버튼을 누르고 로그인 되어있던 계정을 누르면 toast로 써둔 "로그인 성공"이라는 메세지가 안 뜸 일단 MainActivity.kt에 쓴 코드와activity_main.xml에 쓴 코드를 올리겠습니다 //MainActivity.kt에 쓴 코드package com.example.mysampleapp import com.example.mysampleapp.databinding.ActivityMainBinding import android.os.Bundle import android.widget.Button import android.widget.EditText import android.widget.Toast import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.databinding.DataBindingUtil import com.google.firebase.auth.FirebaseAuth import com.google.firebase.auth.ktx.auth import com.google.firebase.ktx.Firebase class MainActivity : AppCompatActivity() { private lateinit var auth: FirebaseAuth private lateinit var binding : ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { // Initialize Firebase Auth auth = Firebase.auth super.onCreate(savedInstanceState) enableEdgeToEdge() setContentView(R.layout.activity_main) Toast.makeText(this, auth.currentUser?.uid.toString(),Toast.LENGTH_SHORT).show() binding = DataBindingUtil.setContentView(this, R.layout.activity_main) val joinBtnClicked = findViewById<Button>(R.id.joinBtn) joinBtnClicked.setOnClickListener { // 첫번째 방법 // val email = findViewById<EditText>(R.id.emailArea) // val pwd = findViewById<EditText>(R.id.pwdArea) //두번째 방법 val email = binding.emailArea val pwd = binding.pwdArea auth.createUserWithEmailAndPassword( email.text.toString(), pwd.text.toString() ) .addOnCompleteListener(this) { task -> if (task.isSuccessful) { Toast.makeText(this,"ok",Toast.LENGTH_SHORT).show() } else { Toast.makeText(this,"no",Toast.LENGTH_SHORT).show() } } binding.logoutBtn.setOnClickListener{ auth.signOut() Toast.makeText(this,auth.currentUser?.uid.toString(),Toast.LENGTH_SHORT).show() } binding.loginBtn.setOnClickListener{ val email = binding.emailArea val pwd = binding.pwdArea auth.signInWithEmailAndPassword( email.text.toString(), pwd.text.toString() ) .addOnCompleteListener(this) { task -> if (task.isSuccessful) { //성공하면 Toast.makeText(this, "로그인 성공", Toast.LENGTH_SHORT).show() //성공하면 UID 값을 띄워보자↓ Toast.makeText(this,auth.currentUser?.uid.toString(),Toast.LENGTH_SHORT).show() } else { //실패하면 Toast.makeText(this, "로그인 실패", Toast.LENGTH_SHORT).show() } } } } } }//activity_main.xml에 쓴 코드<?xml version="1.0" encoding="utf-8"?> <layout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="vertical"> <EditText android:id="@+id/emailArea" android:hint="email" android:layout_width="match_parent" android:layout_height="wrap_content"/> <EditText android:id="@+id/pwdArea" android:hint="pwd" android:layout_width="match_parent" android:layout_height="wrap_content"/> <Button android:id="@+id/joinBtn" android:text="회원가입" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:id="@+id/logoutBtn" android:text="LOGOUT" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:id="@+id/loginBtn" android:text="LOGIN" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> </layout>긴 글 읽어주심에 감사합니다....😥😥
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
몽고DB
몽고db질문입니다. 코드를 따라해보는중 몽고DB에서 데이터부분이 안들어 왔습니다. 어떤부분이 문제인지 궁금합니다.
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
갤럭시 연결시 게시판에 업로드한 사진이 보이지 않아요.
안녕하세요 코틀린강좌를 통해 안드로이드 앱 제작공부를 하고 있는 학생입니다.다름이 아니라 완성된 앱을 갤럭시 안드로이드폰에 연결하는 작업까지 완료하고 실행하여 오류가 있는 부분을 찾던 중에 게시판에 만들었던 사진첨부 기능이 작동되지 않는것 같아서 문의차 커뮤니티에 올리게되었습니다.위 사진 처럼 글만 입력이 되고 사진은 보이지 않아서 무슨 문제인지 알고 싶습니다!코드는 강좌 그대로 사용했습니다!
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
3-10. 코호트 리텐션 SQL 쿼리 작성하기
코호트 리텐션 시각화하기 부분에서피벗테이블의 값에 설정에 AVERAGE 하는 이유는 무엇인가요?
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
리텐션 SQL 작성하기
쿼리 작성하다가 DISTINCT에 대해 궁금한 점이 생겨 질문 남깁니다!WITH 문 base 와 first_week_data에서 DISTINCT는 중복 방지 즉, 비용 절약을 위해서 쓰는 것으로 이해했습니다. 그렇다면 DISTINCT를 쓰지 않아도 쿼리상 문제는 없는 게 맞을까요?user_count에서 DISTINCT는 유니크 유저수를 위해 꼭 사용해야하는 것으로 이해했습니다.WITH base AS ( SELECT DISTINCT user_id, event_name, DATETIME(TIMESTAMP_MICROS(event_timestamp),'Asia/Seoul') AS event_datetime, DATE(DATETIME(TIMESTAMP_MICROS(event_timestamp),'Asia/Seoul')) AS event_date, user_pseudo_id FROM advanced.app_logs ) ,first_week_data AS ( SELECT DISTINCT user_pseudo_id, DATE_TRUNC(MIN(event_date) OVER (PARTITION BY user_pseudo_id),WEEK(MONDAY)) AS first_week, DATE_TRUNC(event_date,WEEK(MONDAY)) AS week_date FROM base ) ,first_week_diff_data AS ( SELECT *, DATE_DIFF(week_date,first_week,week) AS first_week_diff FROM first_week_data ) ,user_count AS ( SELECT first_week_diff, COUNT(DISTINCT user_pseudo_id) AS user_cnt FROM first_week_diff_data GROUP BY ALL ) ,first_user_count AS ( SELECT first_week_diff, user_cnt, FIRST_VALUE(user_cnt) OVER (ORDER BY first_week_diff) AS first_user_cnt FROM user_count ) SELECT *, ROUND(SAFE_DIVIDE(user_cnt,first_user_cnt),2) AS rentention_ratio FROM first_user_count
-
미해결Flutter로 SNS 앱 만들기
섹션8 게시글 정보가져오기
16:00 에러가 발생되었습니다. 어떻게 해야 하나요.ai로 질문의 답을 받았는데 잘모르겠습니다. void _getFeedList() { WidgetsBinding.instance.addPostFrameCallback((_) async { try { await feedProvider.getFeedList(); } on CustomException catch (e) { errorDialogWidget(context, e); // 에러출력 } }); }이부분을 어떻게 처리하면 됩니까
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
No routes matched location Error Component Stack error 질문입니다.
질문 있어서 남깁니다.메인페이지에서 Link를 타고 upload, list 들어가서 화면이 로드 돼야하는데 돼지 않고 하얀바탕으로 돼면서 Error표시 없이 No routes matched location "/list" Error Component Stack가 표시 됍니다. 어떤문제이고 해결 방법이 무엇인지 궁금합니다.Ps. 질문이 이해 안가실것 같아서 스샷 올려놨습니다.
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
주사위 앱 듣고 있는 중인데 ActivityMainBinding애 import가 보이지 않습니다
<?xml version="1.0" encoding="utf-8"?> <layout> <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#008000" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="100dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="30sp" android:gravity="center" android:textColor="@color/black" android:layout_margin="20dp" android:textStyle="bold" android:text="인생은 주사위 한방에 가는거 아니겠습니까?"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:weightSum="2"> <ImageView android:src="@drawable/dice_1" android:layout_width="120dp" android:layout_height="120dp" android:layout_weight="1"/> <ImageView android:src="@drawable/dice_2" android:layout_width="120dp" android:layout_height="120dp" android:layout_weight="1"/> </LinearLayout> <Button android:id="@+id/DiceStartBtn" android:text="인생 고고" android:layout_width="match_parent" android:background="#@color/black" android:textColor="@color/white" android:layout_height="50dp" android:layout_margin="50dp"/> </LinearLayout> </layout> xml 코드import org.jetbrains.kotlin.storage.CacheResetOnProcessCanceled.enabled plugins { alias(libs.plugins.android.application) alias(libs.plugins.jetbrains.kotlin.android) } android { namespace = "com.seungwon.dice" compileSdk = 34 defaultConfig { applicationId = "com.seungwon.dice" minSdk = 24 targetSdk = 34 versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } dataBinding{ enable=true } } dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.appcompat) implementation(libs.material) implementation(libs.androidx.activity) implementation(libs.androidx.constraintlayout) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) }gradle코드문제 부분입니다
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
왜 주사위 위치가 저렇게 나올까요?
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#008000" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="100dp" tools:ignore="MissingConstraints"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="30sp" android:gravity="center" android:textColor="@color/black" android:layout_margin="20dp" android:textStyle="bold" android:text="인생은 주사위 한방에 가는거 아니겠습니까?"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" tools:ignore="MissingConstraints"> <ImageView android:src="@drawable/dice_1" android:layout_width="120dp" android:layout_height="120dp"/> <ImageView android:src="@drawable/dice_2" android:layout_width="120dp" android:layout_height="120dp"/> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>제대로 따라서 타이핑 한것 같은데 왜 그럴까요?
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
2-11. 윈도우 함수 연습문제 7번
DATETIE_DIFF 함수 사용할 때 오류가 발생합니다무엇이 잘못되었을까요..?WITH base AS ( SELECT event_date, event_timestamp, DATETIME(TIMESTAMP_MICROS(event_timestamp),'Asia/Seoul') AS event_datetime, event_name, user_id, user_pseudo_id FROM advanced.app_logs ) , prev_event_datetime AS ( SELECT *, LAG(event_datetime) OVER(PARTITION BY user_pseudo_id ORDER BY event_datetime) AS prev_event_datetime FROM base ) SELECT *, DATETIME_DIFF(event_datetime,prev_event_datetime, SECOND) AS second_diff FROM prev_event_datetime
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
1-11 현황 파악 분석하기
현황 파악하기 링크 다시 올립니다!피드백 부탁드립니다~
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
target sdk 34, 에뮬레이터 실행 문제 질문
현재 빌드 진행 중 이러한 오류가 발생합니다.7 issues were found when checking AAR metadata:1. Dependency 'androidx.appcompat:appcompat-resources:1.7.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).2. Dependency 'androidx.appcompat:appcompat:1.7.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).3. Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).4. Dependency 'androidx.core:core-ktx:1.13.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).5. Dependency 'androidx.transition:transition:1.5.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).6. Dependency 'androidx.core:core:1.13.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).7. Dependency 'androidx.annotation:annotation-experimental:1.4.0' requires libraries and applications thatdepend on it to compile against version 34 or later of theAndroid APIs.:app is currently compiled against android-33.Recommended action: Update this project to use a newer compileSdkof at least 34, for example 34.Note that updating a library or application's compileSdk (whichallows newer APIs to be used) can be done separately from updatingtargetSdk (which opts the app in to new runtime behavior) andminSdk (which determines which devices the app can be installedon).이후 해결을 위해 build.gradle.kts 파일에서compile, target Sdk를 모두 34로 올리고,dependencies { implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.appcompat:appcompat:1.7.0") implementation("com.google.android.material:material:1.12.0") implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("androidx.databinding:databinding-runtime:8.7.0") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") }dependencies에서 core-ktx 버전을 1.9.0에서 1.13.1로 올렸습니다.이후 빌드에서 오류가 발생하지 않는 걸 확인했습니다.하지만 이후에도run app이 불가능해서 앱을 확인할 수 없었습니다.혹시 sdk 버전 올라가면서 변경할 점이 추가로 있다면 알려주실 수 있나요..
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
1-11. 현황 파악하기
https://www.notion.so/FOODIE-APP-0186b8e16c164701afc3d7afd66a551f?pvs=4현황 파악해봤습니다! 피드백 부탁드립니다~
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
3-13. 리텐션 분석 과제
"3-13. 리텐션 과제 : 꼭 풀어보시고 제출해주세요" 강의 과제 완료하여 제출 합니다. 링크 : 리텐션 분석 과제 "쿼리 검토 요청"이라고 기재되어 있는 부분 쿼리에 이상이 없는지 확인해주시면 감사하겠습니다!그리고 과제하다가 궁금한 점이 있어 "문의사항"도 남겨두었습니다. 해당 부분도 답변 부탁드립니다! 전반적으로 리텐션 분석을 진행하는 과정이 올바른지에 대해서도 피드백을 주시면 많은 도움이 될 것 같습니다! 강의를 통해 정말 많이 배울 수 있었습니다!감사합니다.
-
미해결Vue 3 & Firebase 10 커뮤니티 만들기 풀스택 - "활용편" (with Pinia, Quasar, Tiptap, VueUse)
Firebase Hosting 후 페이지 안뜰 때!
혹시나 저 같으신 분 있으실까봐 공유해요!firebase hosting 후 Deploy complete! 라고 잘 떴는데도 불구하고 본인이 만든 페이지는 안뜨고 저 화면이 나타날때, 1분정도 기다렸다가 새로고침하니까 제대로 뜨네요 ㅎㅎ이런 이유인지 모르고 이것저것 다시 해보다가(삽질 ㅠㅠ)새로 고침 하니까 바로 뜨네요 😅😅
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
1-9. 퍼널 SQL 쿼리 작성하기
강의 보면서 '퍼널별 유저 수 집계' 쿼리 작성했는데 결과값이 올바르게 나오지 않아요... 어디서 잘못 되었을까요?WITH base AS( SELECT event_date, event_name, DATETIME(TIMESTAMP_MICROS(event_timestamp),'Asia/Seoul') as event_timestamp, event_param, user_id, user_pseudo_id, platform, -- event_parma.key PIVOT MAX(IF(event_param.key='firebase_screen',event_param.value.string_value,null)) AS firebase_screen, -- MAX(IF(event_param.key='food_id',event_param.value.int_value,null)) AS food_id, MAX(IF(event_param.key='session_id',event_param.value.string_value,null)) AS session_id FROM advanced.app_logs CROSS JOIN UNNEST(event_params) as event_param GROUP BY ALL) -- event_name + screen (필요한 이벤트만 where 조건에 걸어서 사용) ,filter_event as( SELECT * except(event_name,firebase_screen), concat(event_name,'-',firebase_screen) AS event_name_with_screen FROM base WHERE event_name in ('screen_view','click_payment')) SELECT event_name_with_screen, -- step_number case when event_name_with_screen='screen_view-welcome' then 1 when event_name_with_screen='screen_view-home' then 2 when event_name_with_screen='screen_view-food_category' then 3 when event_name_with_screen='screen_view-restaurant' then 4 when event_name_with_screen='screen_view-cart' then 5 when event_name_with_screen='click_pavement-cart' then 6 else null end AS Step_number, count(DISTINCT user_pseudo_id) as cnt FROM filter_event GROUP BY ALL HAVING step_number IS NOT NULL
-
미해결Flutter로 SNS 앱 만들기
섹션8에서 게시글 정보 가져오기에서 timeStamp에러 입니다.
섹션8에서 게시글 정보 가져오기에서16:00WidgetsBinding.instance.addPostFrameCallback(callback) 나봅니다. 강의처럼 timeStamp가 나오지 않고,그래서 그냥 진행했습니다.WidgetsBinding.instance.addPostFrameCallback((_) async {그런데 다음과 같이 에러가 뜨네요.이런 메세지가 뜨는 이유가 뭔가요
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
[과제] 퍼널 쿼리(피벗테이블 적용) 작성
# base 쿼리 작성 전 생각 흐름 ---------------------------------------------------- ## 1. 테이블 내 데이터 구조 파악 -- select -- * -- from advanced.app_logs -- where -- event_date = '2022-08-01' -- 목적에 맞는 쿼리를 기존 데이터로 구현할 수 있는지 여부 확인 -- 연습문제 결과물 컬럼인 'event_name_with_screen', 'step_number', 'cnt'는 기존 컬럼에 없음. -- 기존 컬럼에 없기 때문에 해당 컬럼을 어떻게 구현해내야 할 지 생각해보기 ## 2. event_name_with_screen 컬럼 구현 순서 및 방법 -- event_name_with_screen는 다음과 같은 value를 가짐 -- 1. screen_view-welcome -- 2. screen_view-home -- 3. screen_view-food_vategory -- 4. screen_view-restaurant -- 5. screen_view-cart -- 6. click_payment-cart -- 위 6가지 value가 기존 컬럼에 있는지 확인해보기 -- 있는 경우 -- 기존 컬럼 활용 -- 없는 경우 -- concat 등으로 새롭게 구현 -- 연습문제에서는 event_name과 event_params.key에 있는 value를 concat 했음. -- event_params.key는 데이터타입이 struct이기 때문에 unnest 필요. -- select -- event_name, -- unnest_event_params -- from advanced.app_logs -- cross join unnest(event_params) as unnest_event_params -- where -- event_date = '2022-08-01' -- unnest 결과물에 피봇테이블 적용하기 -- 피봇테이블로 만들면 직관적으로 event_name과 concat 하기가 용이해서. -- select -- event_name, -- event_date, -- event_timestamp, -- user_pseudo_id, -- max(if(unnest_event_params.key = 'firebase_screen', unnest_event_params.value.string_value, null)) as firebase_screen, -- max(if(unnest_event_params.key = 'food_id', unnest_event_params.value.int_value, null)) as food_id, -- max(if(unnest_event_params.key = 'session_id', unnest_event_params.value.string_value, null)) as session_id -- from advanced.app_logs -- cross join unnest(event_params) as unnest_event_params -- where event_date between '2022-08-01' and '2022-08-18' -- group by 1, 2, 3, 4 ---------------------------------------------------- with base as ( select event_name, event_date, event_timestamp, user_pseudo_id, max(if(unnest_event_params.key = 'firebase_screen', unnest_event_params.value.string_value, null)) as firebase_screen, max(if(unnest_event_params.key = 'food_id', unnest_event_params.value.int_value, null)) as food_id, max(if(unnest_event_params.key = 'session_id', unnest_event_params.value.string_value, null)) as session_id from advanced.app_logs cross join unnest(event_params) as unnest_event_params where event_date between '2022-08-01' and '2022-08-18' group by 1, 2, 3, 4 ), base2 as ( select *, concat(event_name, '-', firebase_screen) as event_name_with_screen from base ) ## 일자별 퍼널 쿼리 , base3 as (select event_date, event_name_with_screen, # 2개 이상 조건을 한 개 컬럼에 적용해야 하기 때문에 case when 사용 case when event_name_with_screen = 'screen_view-welcome' then 1 when event_name_with_screen = 'screen_view-home' then 2 when event_name_with_screen = 'screen_view-food_category' then 3 when event_name_with_screen = 'screen_view-restaurant' then 4 when event_name_with_screen = 'screen_view-cart' then 5 when event_name_with_screen = 'click_payment-cart' then 6 else null end as step_number, # 중복되지 않은 사용자수(비로그인 이용자까지)를 파악하기 위해서 count(distinct 컬럼명) 사용 count(distinct user_pseudo_id) as cnt from base2 group by all # null 값 제외하기 위해서 그룹에 필터링 거는 having 사용 having step_number is not null # 1일부터 보고 싶기 때문에 오름차순(asc) 적용 order by 1 asc) ## 일자별 쿼리 (피벗테이블 적용) select event_date, max(if(event_name_with_screen = 'screen_view-welcome', cnt, 0)) as screen_view_welcome, max(if(event_name_with_screen = 'screen_view-home', cnt, 0)) as screen_view_home, max(if(event_name_with_screen = 'screen_view-food_category', cnt, 0)) as screen_view_food_category, max(if(event_name_with_screen = 'screen_view-restaurant', cnt, 0)) as screen_view_restaurant, from base3 group by all order by 1 asc
-
해결됨BigQuery(SQL) 활용편(퍼널 분석, 리텐션 분석)
1-6. 데이터 PIVOT 연습문제
빅쿼리 날짜 타입 입력할때 큰따옴표, 작은 따옴표 둘 중에 아무거나 입력해도 상관없을까요?