-1

I need to create a case statement in Spotfire please help.

Case WHEN UniqueCount([Product])<5 then UniqueConcatenate([Product]) else "Multipl Products" WHEN UniqueCount([Division])<5 then UniqueConcatenate([Division]) else "Multipl Dev" END

M. Smith
  • 1
  • 5
  • Are you getting an error message? As written, if there is more than 5 products or divisions in your table, you will always hit the multiple. Should you be counting over a subset of records instead of all of them? – Mark P. Nov 30 '18 at 12:06
  • 1
    It looks to me like you actually want this to be two separate columns. – blakeoft Dec 03 '18 at 15:04

1 Answers1

0

per the documentation, CASE statements are only allowed a single ELSE. also I am assuming based on the provided example that you need two separate columns.

column 1 [Products]:

CASE 
  WHEN UniqueCount([Product])<5 then UniqueConcatenate([Product]) 
  ELSE "Multiple Products" 
END

column 2 [Divisions]:

CASE
  WHEN UniqueCount([Division])<5 then UniqueConcatenate([Division]) 
  else "Multiple Divisions" 
END

if this doesn't answer, please edit your question for clarity.

niko
  • 3,946
  • 12
  • 26