4 Replies Latest reply: May 8, 2013 9:23 AM by Kristina Vodich

# Filter on an expression

Hi!

I have an expression which calculates difference between two other expressions. The code is rather difficult to undestand so I'll put it in the comment.

I want to create a filter that suppresses rows which don't match the selection.

I have two input boxes (amount from and amount to) with variables, then I need to use a set analysis or something like that, but I don't have an amount to compare, it's calculated in the expression.

in other words, i have:

expression 1 = a

expression 2 = b

expression 3= a - b

filter 1 (for example, the selection is 0)

filter 2 (for example, the selection is 1)

and i need to see only rows where a-b>=0 and a-b<=1

• ###### Re: Filter on an expression

if(ZnPok='-',

0

,aggr(distinct sum(

aggr( sum (distinct {\$<

[InfoKZ.DeptDate] = {\$(='">='&DATE(vFilterDateShipKZFrom_2) & '<=' &DATE(vFilterDateShipKZTo_2) & '"')}

>}ZakazKZ.purchSum)

*

only(

{\$<

[k_plCurrencyRate.Date] = {\$(='"'&DATE(varDate)&'"')}

>}

k_plCurrencyRate.EXCHRATE

),  ZnPok, ZpG, k_plCurrencyRate.slCurCD)),

ZnPok, ZpG))

+

if(ZnPok='-',0,

aggr(distinct sum(

aggr( sum (distinct {\$<

[InfoKZ.DeptDate] = {\$(='">='&DATE(vFilterDateShipKZFrom_2) & '<=' &DATE(vFilterDateShipKZTo_2) & '"')}

>}NaklKZ.sum)

*

only(

{\$<

[k_invCurrencyRate.Date] = {\$(='"'&DATE(varDate)&'"')}

>}

k_invCurrencyRate.EXCHRATE

), NaklKZ.INVOICE ,ZnPok, ZpG, k_invCurrencyRate.invCurCD)),

ZnPok, ZpG))

• ###### Re: Filter on an expression

Hi,

Try using pre3vious selection concept.

You can use sum({1-\$}sales) as to exclude current selection .

• ###### Re: Filter on an expression

in other words, i have:

expression 1 = a

expression 2 = b

expression 3= a - b

filter 1 (for example, the selection is 0)

filter 2 (for example, the selection is 1)

and i need to see only rows where a-b>=0 and a-b<=1

• ###### Re: Filter on an expression

I think i answered my own question.

I should use if : if (a-b>=0 and a-b<=1,a-b)          on each expression.

Thanks to all who tried to help me!