Forum Discussion
How to decode an enum - Bitwise Operations using flag enums for weekdays
Hi ClaireBear,
I don't quite understand your requirement. Are you trying to invert what day of the week each employee works each week based on the sum of the flag enum for each weekday? But again, based on the information you provided, that doesn't seem quite right. For example, flag enum 62 means that an employee works Monday to Friday. In the table below, the values obtained from Monday to Friday are (1+2+4+8+16)=31 not 62...
1 - Monday - 1
2 - Tuesday - 2
3 - Wednesday - 4
4 - Thursday - 8
5 - Friday - 16
6 - Saturday - 32
7 - Sunday - 64
Could you please share the sample data in your model and the results you expect in order to provide you a suitable solution? Also provide a screenshot of the exact calculation logic and the relevant example. Thank you.
Best Regards
- jrockno4 years agoNew Member
I suspect the enum is actually:
1 - Sunday - 1
2 - Monday - 2
3 - Tuesday - 4
4 - Wednesday - 8
5 - Thursday - 16
6 - Friday - 32
7 - Saturday - 64
Where: Monday to Friday is (2+4+8+16+32)=62.
ClaireBear can you clarify so that we can help? Thank you.