Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator II
Creator II

Error in calculation while using the logic in dimension

Hi there ,

I am using the if logic in dimension field -

=if((Interval(today()-max(daystart(Session_Start)),'D'))> 90 ,Name)

but its giving me Error in calculated dimension.

Please assist.

My requirement is to show the report when (Interval(today()-max(daystart(Session_Start)),'D')) is greater than 90.

Thanks 

1 Solution

Accepted Solutions
Kushal_Chawda

@ashmitp869  You need to use aggr function while using any aggregation function in dimension. You can use this expression in measure instead. If you still want to use it in dimension then try below

=aggr(if((Interval(today()-max(daystart(Session_Start)),'D'))> 90 ,Name),Name)

or

aggr(if((Interval(today()-max(daystart(Session_Start)),'D'))> 90 ,Name),Name,Session_Start)

Note: If there are other dimensions in your table, you need to include that as well in aggr function. check suppress null value option for this calculated dimension

View solution in original post

1 Reply
Kushal_Chawda

@ashmitp869  You need to use aggr function while using any aggregation function in dimension. You can use this expression in measure instead. If you still want to use it in dimension then try below

=aggr(if((Interval(today()-max(daystart(Session_Start)),'D'))> 90 ,Name),Name)

or

aggr(if((Interval(today()-max(daystart(Session_Start)),'D'))> 90 ,Name),Name,Session_Start)

Note: If there are other dimensions in your table, you need to include that as well in aggr function. check suppress null value option for this calculated dimension