Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
snoopyboy2599
Partner - Contributor III
Partner - Contributor III

Calculate inventory when using date related dimensions.

Hi all,

When I display the inventory, I want to use date related dimensions, such as year, quarter, month, dates, in the table.

If I use expression like Sum( { $< date = { '$(= Max (date) )' } > }  Inventory), it will only return the last row correctly and others will be 0s like below.

001.JPG

What I want to see is like this:

Month          Inventory

1                30

2                3000

I understand it's because $(= Max (date) ) = 22, but how do I alter it?

Any ideas?

Thanks in advance.

(above example in attachment)

1 Solution

Accepted Solutions
snoopyboy2599
Partner - Contributor III
Partner - Contributor III
Author

Ok, solved it myself (poor me, no one answers).

The expression should be:

FirstSortedValue(Distinct Aggr(Sum(INVENTORY),DAY),-DAY)

View solution in original post

2 Replies
snoopyboy2599
Partner - Contributor III
Partner - Contributor III
Author

Anyone?

snoopyboy2599
Partner - Contributor III
Partner - Contributor III
Author

Ok, solved it myself (poor me, no one answers).

The expression should be:

FirstSortedValue(Distinct Aggr(Sum(INVENTORY),DAY),-DAY)