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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is wrong with this formula?

=Sum({$<Month =>} If(InYearToDate(GLTranDate, vMaxDate, 0, 7), If(GLClearingFlag = 'O',GLBalanceSheetTranAmount + Column(4),GLBalanceSheetTranAmount)))

I get 'Allocated memory exceeded' using this formula.

Essentially I want to show YTD of GLBalanceSheetTranAmount. If the Account has GLClearingFlag = 'O' then add column 4 figures, else just sum the GLBalanceSheetTranAmount column by itself.

Is there a glaring mistake i'm making here?

FYI: Column 4 is a Set Analysis column for Previous YTD

Sum({$<[FinYear]={$(=max([FinYear])-1)},Month=>} GLBalanceSheetTranAmount)

2 Replies
Not applicable
Author

Any ideas?

johnw
Champion III
Champion III

Nothing is jumping out at me. I'd simplify it slightly like this...

sum({<Month=>} GLBalanceSheetTranAmount + if(InYearToDate(GLTranDate,vMaxDate,0,7) and GLClearingFlag='O',column(4)))

... but I would expect the exact same result. If you have other date fields that can be selected, you might need to list more of them where you list the Month. Same thing in your previous YTD expression. You might also need to format the max([FinYear])-1 expression again to match FinYear, depending on how it is defined. Assuming it's just a number like 2009, it should be fine as is. But I don't see anything in either expression that I would expect to blow up your memory.