2017-06-01ãã1ã¶æéã®è¨äºä¸è¦§
åå¼·ä¼ã§çºè¡¨ããã®ã§å 容ãé©å½ã«ã¾ã¨ãã¦ããã°è¨äºã«ãã¦ãããã¤ã®éã«ããªãã¡ã¬ã³ã¹ãæ¥æ¬èªåããã¦ããã®ã§ãå ¨é¨ä¸èªããã人ã¯ãã¡ããèªãã ã»ãããããã SQL Reference | BigQuery Documentation | Google Cloud Platform ã¡ãªã¿ã«æ¥æ¬èªçã®â¦
LTV(lifetime value)ã¨ãã顧客(ã¦ã¼ã¶ã¼)ãå°æ¥çã«ä½¿ãéé¡ãäºæ¸¬ãããã¨ãã話ãããã¾ã åã«ä»¥ä¸ã®è¨äºã§ãæ¸ãã¾ããããæé¡èª²éå¶ã®ãµã¼ãã¹ã ã¨ç²ãæ¨å®ã¨ãã¦è§£ç´çãä¸å®ã¨ã¿ãªãã¦è§£ç´çã®éæ°ãå¹³åç¶ç¶æéã¨ãã¦LTVãè¨ç®ããããã¦ãã¾ã sâ¦
ã¯ã¦ãªããã°ã®è¨äºã®ä¸ã«é¢é£è¨äºã表示ããæ©è½ã追å ããã¾ãã 表示ä½ç½®ãåºå®ã§ãã¾ãã¡ã ã£ãã®ã§ã表示ä½ç½®ã移åã§ããªãããªã£ã¦è©¦ãã¦ã¿ã¾ãã staff.hatenablog.comã¯ã¦ãªããã°ã®è¨å®(ãã¶ã¤ã³)ã«ä»¥ä¸ã®ãããªã¿ã°ãæ¸ãã°ããã§ã表示ä½ç½®ã®æâ¦
BigQueryã«ã¯JSONå½¢å¼ã®æååããå¤ãåãåºãé¢æ°ãããã®ã§ã¹ãã¼ãã¬ã¹ãªæãã§ä½¿ããã¨ãã§ãã¾ã ãã ãJSONãå ¥ããã¨Webã®ã³ã³ã½ã¼ã«ä¸ã§è¦ãã¨ãã«æ¹è¡ãªã©ãç¡è¦ããã¦ãJSONã®å 容ã確èªãã¥ããã®ã§é©å½ã«æ´å½¢ãã¦è¡¨ç¤ºç¢ºèªããæ¹æ³ãæ¸ãã¦ããâ¦
BigQueryèªä½ã«ã¯é¡ä¼¼æååæ¤ç´¢ã®æ©è½ã¯ãªãã®ã§ãæån-gramã®ã³ãµã¤ã³é¡ä¼¼åº¦ãæ±ããSQLãæ¸ãã¦ä¼¼ã¦ããæååã®æ¤ç´¢ããã¾ã ã¡ãªã¿ã«åç´ã«ããæååãå¥ã®æååã«å«ã¾ãã¦ãããã©ãããã¿ãããªãWHEREã«ã«ã©ã å`LIKE '%æ¢ãããæåå%'ã®ãããªâ¦
å½¢æ ç´ è§£æå¨ã§åå²ãã¦ããBigQueryã«è¼ããã°ããã§ããã£ã¦è©±ã§ã¯ããã®ã§ãããæ¢ã«è¼ã£ã¦ãããã¼ã¿ã ã£ããããã°ãè¼ããããã»ã¹ã«å½¢æ ç´ è§£æãæ°ãã«åã¾ããã®ã¯å¤§å¤ã ã£ãããã¾ã ã¨ãããã試ãã¦ã¿ããã ãã®æã«æ°è»½ã«ããããã®ã§ãBigQueryâ¦
BigQueryã®Standard SQLã使ã£ã¦ãã¦é åããä½ç½®ãæå®ãã¦è¦ç´ ãåãåºããã¨ã¯ã§ããã®ã§ãããUNNEST()ã使ã£ã¦ããããã®è¦ç´ ãåãåºããæã«ããè¦ç´ ãä½çªç®ãã¨ããæ å ±ãä¸ç·ã«å¾ãæ¹æ³ãããããªãã£ãã®ã§ããæ¹ãèãã¾ãã(ããããããç°¡åã«â¦