Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error - Expected ')'

Hello,

I'm struggling to identify where the error is occurring in the following expression:

=Month(max(Date)) & ' vs ' & Month(max(Date)-31) & chr(10) & 'Spending' & chr(10) &

num(fabs($(vMonthSpending) - $(vLastMonthSpending) / $(vMonthSpending)), '(##.00%)')

I'm trying to get a text output of a selected month vs. last month's spending increases as a percentage.

Here is the expression for the Year vs. Last Year spending increase that executes successfully:

=max(Year) & ' vs ' & (max(Year)-1) & chr(10) & 'Spending' & chr(10) &

num(fabs($(v2017Spending) - $(v2016Spending) / $(v2017Spending)), '(##.00%)')

Any advice or assistance is much appreciated.

Best,

AR

19 Replies
Not applicable
Author

Thanks for the suggestion - can you explain how to see if the variables hold data? I'm not seeing anything in the variable overview tab.

sasiparupudi1
Master III
Master III

Try in steps.

($(v2017Spending) - $(v2016Spending)) / $(v2017Spending).. if this works,

please try

=num(fabs(

($(v2017Spending) - $(v2016Spending)) / $(v2017Spending)

)

, '(##.00%)')

hth

Sasi

Not applicable
Author

Thanks for the answer, Sasi. However, that doesn't change the error message.

sasiparupudi1
Master III
Master III

Try Changing

=count({<Month = {$(=max(Month)-31)}>} distinct Amount)

to

=count({<Month = {$(max(Month)-31)}>} distinct Amount)

Not applicable
Author

Here's a screenshot of the error message. The red box is my area of concern.

Anonymous
Not applicable
Author

Can you provide what each of your variables is calculating out to?

vishsaggi
Champion III
Champion III

Can you share your script where you defined these variables?

Not applicable
Author

vLastMonthSpending:

=count({<Month = {$(=max(Month)-31)}>} distinct Amount)

vMonthSpending:

=count({<Month = {$(=max(Month)-31)}>} distinct Amount)

vishsaggi
Champion III
Champion III

Are you using LET or SET here? Can you use a text object and display one of the variables and see what it displays?

And what are the values that hold Month field or they numbers or Text chars like Jan, Feb, Mar.....etc.

May be you need to add some other expression inside your variables..

richard_chilvers
Specialist
Specialist

...was this resolved - I'm getting the same error.