AnsweredAssumed Answered

Sorting policies by underwriter

Question asked by Jonathan Garabos on Jan 30, 2019
Latest reply on Jan 31, 2019 by Jonathan Garabos

Hi all,

 

I'm wondering where would be the best place to insert a ".sort('')" functionality as I have tried placing it where I though it made sense (please see below examples) to filter several policies by underwriter but the result was actually quite confusing:

 

Formulas:

Using underwiter sorting

<:for item in ([r for r in $client.insurance_by_cover.sort(‘coy’) if not str(r.valueOf(‘policy_status’)) in [‘Cancelled’, ‘Lapsed’, ‘Expired’, ‘Void’]]):>

<:=item.coy:>

<:end:>

 

Not using underwiter sorting

<:for item in ([r for r in $client.insurance_by_cover if not str(r.valueOf(‘policy_status’)) in [‘Cancelled’, ‘Lapsed’, ‘Expired’, ‘Void’]]):>

<:=item.coy:>

<:end:>

 

Result:

Using underwiter sorting

Zurich

AIA Australia

AAMI

BHP Billiton

Christian Super

AMP

Zurich

Aon

 

Not using underwiter sorting

Zurich

Zurich

AMP

AIA Australia

Aon

AAMI

BHP Billiton

Christian Super

 

As you can see it is all over the place, any idea what's going wrong here?

 

Cheers

Outcomes