Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

asmithbi
Contributor II

Set Analysis with Multiple Modifiers

Hi,

I'm trying to pull the quantity on hand (QOH) from a table that contains QOH per year per period.  The set analysis below has multiple modifiers to filter the QOH for the year and period.  I'm not getting errors, but the result is 0 (zero).  I'm not sure where my set expression is failing.  Any assistance would be very much appreciated.

Thank you in advance.

=Num((Sum({$<FiscYear={$(=Max(FiscYear))}, FiscPer={$(=Max(FiscPer))}> } QtyOnHand)))

Tags (1)
1 Solution

Accepted Solutions
anbu1984
Honored Contributor III

Re: Re: Set Analysis with Multiple Modifiers

Check this

9 Replies
sergey_maka8
Valued Contributor

Re: Set Analysis with Multiple Modifiers

Hi Alec,

It's hard to say without app.

Please share your app or data sample

Regards,

Sergey

asmithbi
Contributor II

Re: Re: Set Analysis with Multiple Modifiers

Hi Sergey,

See attached app.  I added a Bookmark called Item: 8202030.  This particular item has QOH. 

Thank you,

Alec

anbu1984
Honored Contributor III

Re: Set Analysis with Multiple Modifiers

=Num((Sum({$<FiscYear={$(=Max(FiscYear))},  FiscPer={$(=Date(Max(FiscPer),'MMM'))}> } QtyOnHand)))

asmithbi
Contributor II

Re: Set Analysis with Multiple Modifiers

Anbu,

Thank you for the fix.  I am now getting numbers.  However, the quantity is not agreeing to the source system.  Also, when I filter on any FiscPer, the quantity does not change.  It is remaining at 1,352. 

anbu1984
Honored Contributor III

Re: Set Analysis with Multiple Modifiers

=Num((Sum({$<FiscYear={$(=Max(FiscYear))},  FiscPer={$(=Month(Date#(Max({<FiscYear = {$(=Max(FiscYear))}>} FiscPer),'MM')))}> } QtyOnHand)))

anbu1984
Honored Contributor III

Re: Re: Set Analysis with Multiple Modifiers

Check this

sergey_maka8
Valued Contributor

Re: Re: Set Analysis with Multiple Modifiers

Alec,

I just can't understand why do you use set analysis here..

Try to use the following expression

=Num(Sum(QtyOnHand))

PFA

asmithbi
Contributor II

Re: Set Analysis with Multiple Modifiers

Works!!!  Thank you Anbu!!! 

asmithbi
Contributor II

Re: Set Analysis with Multiple Modifiers

Sergey,

You are correct in what you are saying.  The full purpose of the expression will be to calculate inventory turnover.  I need to first compute the average inventory for the period -  (beginning inventory + ending inventory)/2

Now that I have the current period working, I need to calculate the beginning inventory which is the ending inventory from the previous period using -1 in the modifier.   

Community Browser