Skip to main content
May 14, 2021 2:33 AM UTC
Solved

If condition not working in member formula

Originally posted by Rahul Joshi

I am trying refer a intersection in member formula and apply condition based on the referenced cell.

 

 

Dim nvASP As DataCell = api.Data.GetDataCell("A#[ASP (£)]:F#No_Curr:I#None:U1#[Adjustment (Override)]:U2#None:U4#None:U5#None:U6#None:U8#None")

If nvASP.CellStatus.CellAmount = 0.0 Then

api.Data.Calculate("F#No_Curr:O#Forms:U1#Total:U2#None:U4#None:U5#None:U6#None:U8#None:I#None:A#[ASP (£)] = F#No_Curr:O#Forms:U1#Calculated:U2#None:U4#None:U5#None:U6#None:U8#None:I#None:A#[ASP (£)]")

Else

api.Data.Calculate("F#No_Curr:O#Forms:U1#Total:U2#None:U4#None:U5#None:U6#None:U8#None:I#None:A#[ASP (£)] = F#No_Curr:O#Forms:U1#[Adjustment (Override)]:U2#None:U4#None:U5#None::U6#None:U8#None:I#None:A#[ASP (£)]",,,True)

 

 

It does not consider the if-else condition and just process the first condition .
Something which i am doing wrong in here ?

Answer
May 26, 2021 4:39 PM UTC
Originally posted by Colin ONeill

I notice there is no END IF at the end.

2 replies

Answer
May 26, 2021 4:39 PM UTC
Originally posted by Colin ONeill

I notice there is no END IF at the end.

ChristianW
Employee - Advisor
Employee - Advisor
Oct 18, 2021 10:48 AM UTC

You need to specify all pov members to get the correct datacell, in this case, origin isn't specified and the function probably returns an empty datacell with a value of 0.