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

Nested IF working for expression but not dimension

Oddly the below expression works fine as my dimension in a straight table

=IF([launched in last 6 months]='Yes',0,Market)

But when I add a 2nd IF statement to it, i get 'Error in Calculated dimension'

=IF([launched in last 6 months]='Yes',0,

       IF(SUM({1<WeeksAgo={'<=12'}>}Revenue)=0,0,

            Market))

What's even weirder is that this works fine when used as an expression, rather than a dimension

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

=IF([launched in last 6 months]='Yes',0,

       IF(Aggr(SUM({1<WeeksAgo={'<=12'}>}Revenue),Market)=0,0,

            Market))

View solution in original post

3 Replies
tresesco
MVP
MVP

Try like:

=IF([launched in last 6 months]='Yes',0,

       IF(Aggr(SUM({1<WeeksAgo={'<=12'}>}Revenue),Market)=0,0,

            Market))

Not applicable
Author

Hi Alex,

you can't use an aggregation function in a calculated dimension, without wrapping it in aggr. Have a look at the below for help

AGGR...

QlikView Technical Brief - AGGR

hope that helps

Joe

Not applicable
Author

that worked. Thanks!!!