Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Expression for all existing Year(WBS)

Hi experts

A table with two different dimensions on year: Year(Production) and Year(WBS). The formula is as follows:  Sum({<[Year (Production)]={$(=max([Year (Production)]))}>}  [# open])

The result in the table is correct. If you remove the column for Year(WBS) the result changes to 5 which is incorrect. How do you modify above formula to get the correct result independent of a column Year(WBS) in the table?

TomBond77_0-1666257242297.png

 

Labels (5)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Try

Sum(Aggr(Sum({<[Year (Production)]={$(=max([Year (Production)]))}>} [# open]),Year (Production),Year(WBS)))

View solution in original post

3 Replies
BrunPierre
Partner - Master II
Partner - Master II

Try

Sum(Aggr(Sum({<[Year (Production)]={$(=max([Year (Production)]))}>} [# open]),Year (Production),Year(WBS)))

TomBond77
Specialist
Specialist
Author

Many thanks, this works!

How should this formula must look like to get the correct result?

RangeSum(Above(Sum({<[Year (Production)]=>} [# open]), 0, RowNo()))

 

 

BrunPierre
Partner - Master II
Partner - Master II

What do you want to achieve?

I believe the Year(Production) in the expression should not be a function but rather a field name

In the script, create

Year(Production) as [Production Year]

and apply as below

RangeSum(Above(Sum({<[Production Year]=>} [# open]), 0, RowNo()))