2016-10-13 28 views

回答

1
You can try below - 
tMysqlInput--->tFlowToIterate---(iterate)-->tMysqlInput--->tFileOutputDelimited 

More details given below - 
tmysqlInput(select user_id from table group by user_id) --- row Main ---> tFlowToIterate (uncheck use the default key option, create a new key called user_id and set value to user_id in dropdown) ----- Iterate -----> tmysqlInput(sql = "select user_id, order_id,purchase_date from table where user_id=((String)globalMap.get("user_id))") ----- row main ----> tFileOutputDelimited(set filename = (String)globalMap.get("user_id))+".csv"). 

     to summarize - you first get list of all distinct user_id then you iterate through each of them and again fetch orders for each user_id by applying filter and use this user_id value from global variable into filename.. 
+0

謝謝你..這是工作的罰款,我剛纔固定類似下面的語法: tmysqlInput( sql =「select user_id,order_id,purchase_date from table where user_id =」+ globalMap.get(「user_id」); –

相關問題