Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to insert my field = sTOCK into my expression ?

Hi All

I hv below expression working fine , need to click on button to filter GL_CODE=50010

=

(RangeSum(

Above(RangeSum(Above(Sum({<year, month>}[Amount]*-1), 0, RowNo()))),

-Sum(TOTAL Aggr(Sum({<year, month>}[Amount]*-1), YearMonth)))

)

I have add the field for sTOCK , which will filter GL_CODE=50010:-

If([Reporting Code]>=50010 and [Reporting Code]<=50010,'sTOCK') as [sTOCK],

My i know how to insert the filed sTOCK into above expression ?

Table 1 16 April should get -111,135 Amount.

Paul

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=

(RangeSum(

Above(RangeSum(Above(Sum({<year, month, sTOCK = {'sTOCK'}>}[Amount]*-1), 0, RowNo()))),

-Sum(TOTAL {<sTOCK = {'sTOCK'}>} Aggr(Sum({<year, month, sTOCK = {'sTOCK'}>}[Amount]*-1), YearMonth)))

)

View solution in original post

6 Replies
paulyeo11
Master
Master
Author

My QV Doc

sunny_talwar

May be this:

=

(RangeSum(

Above(RangeSum(Above(Sum({<year, month, sTOCK = {'sTOCK'}>}[Amount]*-1), 0, RowNo()))),

-Sum(TOTAL {<sTOCK = {'sTOCK'}>} Aggr(Sum({<year, month, sTOCK = {'sTOCK'}>}[Amount]*-1), YearMonth)))

)

paulyeo11
Master
Master
Author

Hi Sunny

Hi Sunny

Many Thank , Your expression work fine.

But why when i with out filter GL_CODE = 50010 Table 2 not  work  ?

Yet Table 1 working fine with same expression ?

Also  I aware that above(Rangesum does not support V9 of QV ) But now okay .

Paul

sunny_talwar

Did not notice that there were two tables. I will look at it in a little bit.

sunny_talwar

Is this you are looking for?

paulyeo11
Master
Master
Author

Hi Sunny

Table 1 is before you add filter on sTOCK.on 2nd expression.

Table 2 is after you add filter on sTOCK on 2nd column expression.

And now Column 1 and 2 expression working fine on Table 2.

My question is , SET expression should be not affected other expression in same table ? why this case it happen ?

Can you share with me ?

Paul