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: 
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
vishsaggi
Champion III
Champion III

Where are you getting this error? in Text box or while reloading? Can you share a snapshot?

Anonymous
Not applicable
Author

Yours looked fine but you could try...................


=Month(max(Date)) & ' vs ' & Month(AddMonths(Monthstart(max(Date)),-1)) & chr(10) & 'Spending' & chr(10) &
num(fabs($(vMonthSpending) - $(vLastMonthSpending) / $(vMonthSpending)), '(##.00%)')

Not applicable
Author

on the last part try removing the quotes, and putting the % at the end with & '%'

Not applicable
Author

Hey Wallo,

Just gave this a try and I'm still getting the same error readout. Thanks for the suggestion, but I'm still not sure what the issue is.

Anonymous
Not applicable
Author

Can you share a sample app?

Anonymous
Not applicable
Author

You could try

=Month(max(Date)) & ' vs ' & Month(AddMonths(Monthstart(max(Date)),-1)) & chr(10) & 'Spending' & chr(10) & '(' &
num(fabs($(vMonthSpending) - $(vLastMonthSpending) / $(vMonthSpending)), '##.00%') & ')'

jwbadger3
Contributor II
Contributor II

Also try checking your variable expressions. It's possible you're missing something in one of them and the error is occurring during the dollar sign expansion on execution of the expression.

Not applicable
Author

Here is the variable script:

vLastMonthSpending:

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

vMonthSpending:

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

vishsaggi
Champion III
Champion III

When you check your variables are they holding any data? Use Ctrl+Alt+V and see what values you can see for these variables? Can you share a sample if possible that has this issue?