Data Studio
3.1K members online now
3.1K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

CASE WHEN Limitation

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello all,

 

So I am using CASE WHEN to create a calculated field that doesn't exist in the data export.  Essentially a "Category" field for my courses.  The formula and subsequent reporting was working perfectly and then when I added the next string of courses, I get a "parsing" error.  Does anyone know if there is a character or statement limit for the CASE WHEN function.  Below is the function text that is now giving me the error (I deleted the last string of courses as a test, and the formula worked).

 

CASE WHEN REGEXP_MATCH(course_title, "(Veteran 101: DoD Overview|15 Things Veterans Want You to Know|Veteran 201: Veterans ( IVMF )|Veteran 201: Veterans|Veteran 201: Timeline of Current Wars ( IVMF )|Veteran 201: Timeline of Current Wars|Veteran 201: Profession vs. Occupation ( IVMF )|Veteran 201: Profession vs. Occupation|Veteran 201: Military Lingo and Discharges|Veteran 201: Military Families|Veteran 101: Service Branch Overview|Veteran 101: Officer vs. Enlisted|Veteran 101: Military Laws and Regulations|Veteran 101: Military Culture|Veteran 101: DoD Overview|Invisible Wounds of War Overview)") THEN "Military Culture" WHEN REGEXP_MATCH(course_title, "(15 Things Veterans Want You to Know for Healthcare Providers|Academic Reasonable Accommodations|Barriers to Treatment|Connecting with the VA|Evidence-based Treatments|Deployment Cycle Effects|Inner Conflict and Survivor's Guilt|Intimacy and Emotional Disconnect in Military Populations|Intimacy Issues with Military and Veteran Connected Couples|Intimate Partner Violence|Military Sexual Trauma|Military Women|Posttraumatic Stress Disorder (PTSD)|Substance Use in the Military Veteran Populations|Suicide in the Military|The Brain and Combat Stress|The Cost of Caring|Traumatic Brain Injury)") THEN "Healthcare" WHEN REGEXP_MATCH(course_title, "(ABC's of Respite for Caregivers|Choosing Your Words|Coaching a Loved One Into Care|Creating a Space for You|Focusing on the Forgotten...Me!|Good Grief|Goodbye to Going It Alone|How to be a Mental Healthcare Advocate|How to Connect with a Checked Out Veteran|Invisible Wounds of War at Home: Depression|Invisible Wounds of War at Home: Posttraumatic Stress Disorder (PTSD)|Invisible Wounds of War at Home: Substance Use Disorder|Invisible Wounds of War at Home: Traumatic Brain Injury|Invisible Wounds of War at Home: What Are Invisible Wounds?|Leaning In: Investing in a Challenging Relationship|Mantram|Stepping Into Stillness: Maintaining Your Center of Gravity When Caring for a Veteran Loved One|Understanding the VA for Caregivers)" THEN "Caregivers" WHEN REGEXP_MATCH(course_title, "(Advanced De-escalation Technique for Volunteers|Communication Skills with Veterans|Helping Others Hold On|How to Interact with Assistance Animals|How to Talk to Someone with a Disability|Recreational Volunteer Opportunities with Disabled Veterans|Setting Boundaries as a Volunteer|Supporting a Surviving Loved One|Supporting Someone with Invisible Wounds|Trauma Informed Interactions with Veterans)") THEN "Volunteer" ELSE "Course" END

CASE WHEN Limitation

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

my own experience is better to do the calculation at the source level if possible. I like to think of GDS as a visualization tool only. 

CASE WHEN Limitation

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

I just ran into this issue. I have 327 cases and got the "Number of conditions in CASE exceeds limit" error message. Any way around this? Wondering if I can do the translation somewhere else? I'm essentially translation a dimension that's a random value into a branch name