12 Replies Latest reply: Dec 18, 2017 2:38 AM by Yeo Poh sai

# Expression work for 1 variable but not work for 2 variable

Hi All

I have create a variable = Days

and i insert the above variable to below expression , it work fine :-

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(=vDay)'} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(=vDay)'} >}total_ar  * 1))

Due to i need to add one more variable , so i create one more variable = Days1

and again i insert to my expression , but it cannot work.

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(=vDay)''<=\$(=vDay1')} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(=vDay)''<=\$(=vDay1)'} >}total_ar  * 1))

Hope some one can share with me where i go wrong ?

Paul

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi,

Can you try like below,

Sum({\$<SEGMENT -= {'Related Coy'},total_ar={">0"},aging_ar = {'>=\$(=\$(vDay))<=\$(=\$(vDay1))'} >}total_ar  * 1)

or try this way

Sum({\$<SEGMENT-= {'Related Coy'},total_ar={">0"},aging_ar = {'>=\$(vDay)<=\$(vDay1)'} >}total_ar  * 1)

Thanks,

Deva

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Deva

Thank you very much it work fine.

Paul Yeo

• ###### Re: Expression work for 1 variable but not work for 2 variable

I already explain, To each From and To buckets you need Double Quotes "" not single one as Set analysis is good for setting. Let's try now

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(=vDay)''<=\$(=vDay1')} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(=vDay) <=\$(=vDay1)"} >}total_ar  * 1))

OR

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=\$(vDay)''<=\$(vDay1')} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(vDay) <=\$(vDay1)"} >}total_ar  * 1))

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

I have test your expression , it does not work. Since Deva expression is working fine. i am using it. Thank you for your help.

Paul

• ###### Re: Expression work for 1 variable but not work for 2 variable

My Bad, You should've change into If level as well

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(=vDay) <=\$(=vDay)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(=vDay) <=\$(=vDay1)"} >}total_ar  * 1))

OR

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(vDay) <=\$(vDay1)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(vDay) <=\$(vDay1)"} >}total_ar  * 1))

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

Now your expression is working fine. and display the correct amount .

Deva table 1A display 11,766 is correct.

Anil Table 1B display 11,616 is wrong. ( As your expression does not filter Comms Technology Pte LTd amount 150 )

Not sure why ?

Paul

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

Now your expression is working fine. and display the correct amount .

Anil Table 1B display 11,616 is wrong

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

My typing mistake , Table 1B is correct.

Paul

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

Thank you for your link , yes , i think it is due to the expression reduce to one line from two line. ( I have forgotten why i need 2 line of expression )

Paul

• ###### Re: Expression work for 1 variable but not work for 2 variable

Because, You want to get only more than 0 values. So, The thought is If..Else.. Condition only. To do in single line. You may try this?

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(vDay) <=\$(vDay1)"}, total_ar = {"=Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=\$(vDay) <=\$(vDay1)"} >}total_ar  * 1)>0"} >}total_ar  * 1)

• ###### Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

Thank you very much for the signal line expression , But the signal line expression seem very long , and more difficult to maintenance.

I will stick with the orgnial expression. Now i am happy that i can reduce the 5 number tab to signal tab.

Paul