Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

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

Re: How to insert my field = sTOCK into my expression ?

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)))

)

6 Replies
paulyeo11
Valued Contributor II

Re: How to insert my field = sTOCK into my expression ?

My QV Doc

Re: How to insert my field = sTOCK into my expression ?

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
Valued Contributor II

Re: How to insert my field = sTOCK into my expression ?

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

Re: How to insert my field = sTOCK into my expression ?

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

Re: How to insert my field = sTOCK into my expression ?

Is this you are looking for?

paulyeo11
Valued Contributor II

Re: How to insert my field = sTOCK into my expression ?

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

Community Browser