來源:
下面的資料集含有應用程式「Myco ExampleApp」發佈後不久的虛構推文訊息。
Date | twitterId | isEmployee | tweet |
---|---|---|---|
11/5/15 | lawrencetlu38141 | FALSE | Just downloaded Myco ExampleApp! Transforming data in 5 mins! |
11/5/15 | petramktng024 | TRUE | Try Myco ExampleApp, our new free data wrangling app! See www.example.com. |
11/5/15 | joetri221 | TRUE | Proud to announce the release of Myco ExampleApp, the free version of our enterprise product. Check it out at www.example.com. |
11/5/15 | datadaemon994 | FALSE | Great start with Myco ExampleApp. Super easy to use, and actually fun. |
11/5/15 | 99redballoons99 | FALSE | Liking this new ExampleApp! Good job, guys! |
11/5/15 | bigdatadan7182 | FALSE | @support, how can I find example datasets for use with your product? |
分析報告中包含兩個部分:
- 針對非員工,您想知道他們是否提到新產品的名稱。
- 針對員工,您想知道他們是否在推文中加入了網站的交叉參照。
轉換:
下列指令會計算 tweet
資料欄中 ExampleApp
字串的出現次數。請注意如何使用 ignoreCase
參數分辨大寫字體差異:
countpattern col:tweet on:'ExampleApp' ignoreCase:true
針對非員工,您想要追蹤他們是否在推文中提到產品:
derive type:single value:IF(isEmployee=='FALSE' && countpattern_tweet=='1',true,false) as:'nonEmployeeExampleAppMentions'
以下指令計算非員工推文中,example.com
的出現次數:
countpattern col:tweet on:'example.com' ignoreCase:true
針對員工,您想要追蹤他們是否在推文中加入上述的交叉參照:
derive type:single value:IF(isEmployee=='TRUE' && countpattern_tweet1 == 1, true, false) as:'employeeWebsiteCrossRefs'
結果:
將顯示計數的兩個資料欄刪除後,會得出以下結果:
Date | twitterId | isEmployee | tweet | employeeWebsiteCrossRefs | nonEmployeeExampleAppMentions |
---|---|---|---|---|---|
11/5/15 | lawrencetlu38141 | FALSE | Just downloaded Myco ExampleApp! Transforming data in 5 mins! | false | true |
11/5/15 | petramktng024 | TRUE | Try Myco ExampleApp, our new free data wrangling app! See www.example.com. | true | false |
11/5/15 | joetri221 | TRUE | Proud to announce the release of Myco ExampleApp, the free version of our enterprise product. Check it out at www.example.com. | true | false |
11/5/15 | datadaemon994 | FALSE | Great start with Myco ExampleApp. Super easy to use, and actually fun. | false | true |
11/5/15 | 99redballoons99 | FALSE | Liking this new ExampleApp! Good job, guys! | false | true |
11/5/15 | bigdatadan7182 | FALSE | @support, how can I find example datasets for use with your product? | false | false |