Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement - transform from Expression to Script

I got these 2 expressions. IS it possible to "move" them to script? Need to use these as Dimensions other than Expressions in my tables. Thank you.

  1. 1. Status New:

if(
(
sum({<[Rolling Account Year Three]={'Most Recent'},[New/Renewal]={'New'}>} [Written Premium])/1000 >0 and
sum({<[Rolling Account Year Three]={'First Prior'},[New/Renewal]={'New'}>} [Written Premium])/1000=0),'New')

  1. 2. Status:

if(
(
sum({<[Rolling Account Year Three]={'Most Recent'}>} [Written Premium])/1000 - sum({<[Rolling Account Year Three]={'First Prior'}>} [Written Premium])/1000)>0,'Growing',
if(
(
sum({<[Rolling Account Year Three]={'Most Recent'}>} [Written Premium])/1000 - sum({<[Rolling Account Year Three]={'First Prior'}>} [Written Premium])/1000)=00,'NM',
if(
sum({<[Rolling Account Year Three]={'Most Recent'}>} [Written Premium])=0,'Lost',
if(
(
sum({<[Rolling Account Year Three]={'Most Recent'}>} [Written Premium])/1000 - sum({<[Rolling Account Year Three]={'First Prior'}>} [Written Premium])/1000)<0,'Shrinking'))))

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

What are the dimensions of the chart/table containing these expressions?


You could do something like this (add the chart dimensions for dim1, dim2 placeholders below)


LOAD

  dim1,

  dim2,

  if((sum({<[Rolling Account Year Three]={'Most Recent'}, [New/Renewal]={'New'}>} [Written Premium])/1000 >0

  And sum({<[Rolling Account Year Three]={'First Prior'},[New/Renewal]={'New'}>} [Written Premium])/1000=0),'New'

  ) as Expr1,

  ...expr2 here... as Expr2

Resident ...

GROUP By

  dim1,

  dim2

And do the same for the second expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein