Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rendiyan
Partner - Creator
Partner - Creator

[ASK] Create dynamic stock aging as selection

Dear Qlik Master,

I have a requeirement to create stock aging that able to change dynamically, depend on date selection.

And that aging have to able to show as a list box for filter selection.

Currently i able to create this dynamic aging as an expression in a chart, but i can't take it out and make it as a list box selection.

So my chart to create dynamic aging is below :

Capture.PNG

Date, max date, aging, and aging group are expression.

Date column actually only a transaction date column for each stock transaction (in-out) from transaction table.

Max Date is an expression that show max date based on calendar dimension from dimension table..

Aging is an expression based on [Date]-[Max Date].

And Aging Group is a grouping based on [Aging]

and for expression script :

ExpressionExpression Script
Date

aggr(

only(

  {<

  Year={'$(=max(Year))'},

  MonthDay={'<=$(=max( {<Year={'$(=max(Year))'}>} MonthDay))'},

  Quarter=,Month=,Week=,Day=

  >}

  [MS Date]

)

,[MS Date],[Code Region],[Code Brance],[Wh ID],ITEMNO,[Wh Name],[Wh Type]

)

Max Date

max(total<Year,Quarter,Month>

{1<

  Year=P(Year),Quarter=P(Quarter),QuarterNum=P(QuarterNum),

  Month=P(Month),MonthNum=P(MonthNum),

  Day=P(Day),DayNum=P(DayNum)

>}

DATE_DIM)

Aging[Date] - [Max Date]

As additional info, my date selection dimension columns are : Year, Quarter, Month, Day..

And my question is,

is it possible to create dynamic aging as a list box?

If it is yes, is there any way and solution for this?

I've searched it and didn't found.

Many thx,

Best Regards,

2 Replies
rendiyan
Partner - Creator
Partner - Creator
Author

is there no solution for this?

lironbaram
Partner - Master III
Partner - Master III

hi

you can try something like this

put the below expression in a list box

aggr(

only(

  {<

  Year={'$(=max(Year))'},

  MonthDay={'<=$(=max( {<Year={'$(=max(Year))'}>} MonthDay))'},

  Quarter=,Month=,Week=,Day=

  >}

  [MS Date]

)-

max(total<Year,Quarter,Month>

{1<

  Year=P(Year),Quarter=P(Quarter),QuarterNum=P(QuarterNum),

  Month=P(Month),MonthNum=P(MonthNum),

  Day=P(Day),DayNum=P(DayNum)

>}

DATE_DIM)

,[MS Date],[Code Region],[Code Brance],[Wh ID],ITEMNO,[Wh Name],[Wh Type]

)