Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Champion III
Champion III

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

Highlighted
Specialist II
Specialist II

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%)')

Highlighted
Not applicable

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

Highlighted
Not applicable

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.

Highlighted
Specialist II
Specialist II

Can you share a sample app?

Highlighted
Specialist II
Specialist II

You could try

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

Highlighted
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.

Highlighted
Not applicable

Here is the variable script:

vLastMonthSpending:

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

vMonthSpending:

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

Highlighted
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?