Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

error in expression

Hello Guys,

I have en error in my expression bellow :

=num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[Calendar date]={"<$(=Date(AddYear(Today(),-1))"}>} recharge_amount),'# ##0')

Capture.PNG

1 Solution

Accepted Solutions
Colin-Albert

Prashant - To evaluate a function within a set expression you need to enclose the expressions in $(= )

so  = Max([Year of date])-1  will not work,  $(= Max([Year of date])-1 ) is correct. 

Assuming that the field [Year of date] is numeric, there is no need to enclose the set modifier value in quotes.


The error is due to the brackets not matching in the second modifier for Calendar Date

View solution in original post

5 Replies
Colin-Albert

There is a missing bracket

=num(sum( {$<[Year of date]={$(=Max([Year of date])-1) }, [Calendar date]={"<$(=Date(AddYear(Today(),-1)) ) "}>} recharge_amount),'# ##0')

Anil_Babu_Samineni

Could be anyone of these?

=num(sum( {$<[Year of date]={$(=Max([Year of date])-1)},[Calendar date]={"<$(=Date(AddYears(Today(),-1)))"}>} recharge_amount),'# ##0')

OR

=num(sum( {$<[Year of date]={'$(=Date(Max([Year of date])-1))'},[Calendar date]={"<$(=Date(AddYears(Today(),-1)))"}>} recharge_amount),'# ##0')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prashantsanchet
Creator
Creator

Hope this will help:

num(Sum({<[Year of date] = {"= Max([Year of date])-1" },[Calendar date]={"<$(=Date(AddYear(Today(),-1))"} >}recharge_amount),,'# ##0')

Colin-Albert

Prashant - To evaluate a function within a set expression you need to enclose the expressions in $(= )

so  = Max([Year of date])-1  will not work,  $(= Max([Year of date])-1 ) is correct. 

Assuming that the field [Year of date] is numeric, there is no need to enclose the set modifier value in quotes.


The error is due to the brackets not matching in the second modifier for Calendar Date

master_student
Creator III
Creator III
Author

Thanks a lot. all of you