Dear Stata users,

I am working on a dataset with many dummy variables. What I want to achieve is egen a variable that captures the unique value of the different columns. For example,
date wt04 wt09 wt15 wt17 wt18
20040111
20040112 1
20040113 1
20040114 1
20040115 1 1
20040116 1
20040117 1 1 1
20040208
20040209 1
20040210 1
20040211 1
20040212 1
20040213 1
20040214
In the table above, event wt04, wt05, wt15, wt17, wt18 are not mutually exclusive. In other words, they can happen at the same time. I want to create a variable, say wttd, to capture the unique event within the month. For example, in January 2004, the unique event days is 6 rather than 9 (adding all "1" together). Or in February 2018, the unique event day is 5.

I would much appreciate it if anyone can help me with this.

Best,