3.29 Perform complex set-oriented computations on multiple small data files

 

Perform complex set-oriented operations on multiple text files.
User login information is stored in multiple files. Now we want to find users who logged in at least once in three months, those who logged in in each of the three months, and those who logged in only in January.

SPL script:

A
1 =T(“user_login_info_1.xlsx”).group@1(userid)
2 =T(“user_login_info_2.xlsx”).group@1(userid)
3 =T(“user_login_info_3.xlsx”).group@1(userid)
4 =[A1,A2,A3].merge@u(userid)
5 =[A1,A2,A3].merge@i(userid)
6 =[A1,A2,A3].merge@d(userid)

A1 Get information of users’ first logins in January.
A2 Get information of users’ first logins in February.
A3 Get information of users’ first logins in March.
A4 Union, which are users who logged in at least once in the three months.
A5 Intersection, which are users who logged in in each of the three months.
A6 Difference, which are users who logged in only in January.