Forum Discussion
Measure to Segment User Activity
- 3 years ago
bigfun ,
Yes, SWITCH Statement is how I would approach this as well:
LevelofActivity = SWITCH( TRUE(), [Monthly Logins] > 10, "High", [Monthly Logins] >=5, "Medium", "Low" )The last line, is your "else" condition. You can specify your third condition <5 if you want to make it clearer to yourself or others.
Hope this helps.
Regards,
This is perfect... now I just need to figure out how to free up or not use as much memory processing it.. haha
bigfun ,
Glad I could help. I use SWITCH throughout all of my numerous reports. Have never had an issue with memory or resources. Perhaps something else in your model is causing this. Unfortunately, this is out of my scope.
- bigfun3 years agoHelper I
Curious if you have even put a condition on a switch statement.. For example:
I have a column that has a version# 1.0, 2.0, etc, and I only want to run the switch statement on the rows that are version 2.0.- rsbin3 years agoCommunity Champion
bigfun ,
You can try this a couple of different ways:
LevelofActivity = SWITCH( TRUE(), [Version#] <> 2.0, Blank(), // or "Not Applicable" or whatever.... [Monthly Logins] > 10, "High", [Monthly Logins] >=5, "Medium", "Low" )If that doesn't work, then apply the condition to each line of conditions:
LevelofActivity = SWITCH( TRUE(), [Version#] = 2.0 && [Monthly Logins] > 10, "High", [Version#] = 2.0 && [Monthly Logins] >=5, "Medium", [Version#] = 2.0 && [Monthly Logins] < 5 "Low" )