Is there a way to create Case Statements? & nested calculations

Is there a way to use CASE (sql)? Cant find a way to use it.

and on the same note - is there a way to do nested calculations (ifelse inside ifelse) or any way around it?

Hi @Gal -

There is no CASE function but you can use nested ifelse.

Example:

ifelse({Readable_Response} = 'Strongly Agree',5,
ifelse({Readable_Response} = 'Agree',4,
ifelse({Readable_Response} = 'Neither Agree or Disagree',3,
ifelse({Readable_Response} = 'Disagree',2,
ifelse({Readable_Response} = 'Strongly Disagree',1,0
)))))

Hi, I know i can do that, even without the other “if esle”
for example:

ifelse({Readable_Response} = 'Strongly Agree',5,
{Readable_Response} = 'Agree',4,
{Readable_Response} = 'Neither Agree or Disagree',3,
{Readable_Response} = 'Disagree',2,0)

What i am looking for is to insert another calculated filed inside the ifelse it is not letting me do it.
for example:

ifesle ( {Readable_Response} = 'Strongly Agree' AND {calculated field example} > 2 ,5,
{Readable_Response} = 'Agree' AND  {calculated field example} < 2, 4,0 
1 Like

you can do that as long as you keep the same aggregation level throughout.
In your example this means that {calculated field example} should not use aggregate functions such as SUM(), MAX() etc

1 Like

Hi,
sorry for the late reply but it does not work with >2 as well.
how do you know what the aggregation level is