If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Parsing error

Started by sanchoniathon, 20 May 2015 01:40:20 PM

Previous topic - Next topic

sanchoniathon

Hello to all,

I'M getting a parsing error while trying to apply the following logic in the data item:
[date] >= _add_months(?pDate?, -CAST(?pMonths?,INTEGER))

Or while trying the following logic:

If ([date] = _add_months (?pDate?, - ?pMonths? ))
Then ( [Total Sales] )
Else (0)


Or while trying the following logic:

[date] between _add_months(#prompt('pDate','token')#, -1* #prompt('pMonths','token')#) and (_add_months(#prompt('pDate','token')#, #prompt('pMonths','token')#))

Or while trying this:

[date] between _add_months(#prompt('?pDate?','token')#, -1* #prompt('?pMonths?','token')#) and (_add_months(#prompt('?pDate?','token')#, #prompt('?pMonths?','token')#))


Am i missing something like doing a cast on the [date] column ? Or something like it ?

Thank you all for any fast reply!

bdbits

Is [date] actually a date? If not, then you need to cast it.

Same with pDate - it needs to be a date as an argument to _add_months().

sanchoniathon

yes [date] is of type DATE TIME and yes pData is a CALENDAR GREGORIAN prompt type.

Lynn

Why don't you try simplifying the expression to get the correct syntax and then add in the necessary complexity bit by bit to isolate where you are going wrong.



[date] >= _add_months(current_date, -3)


then


[date] >= _add_months(?pDate?, -3)


then


[date] >= _add_months(?pDate?, ?pMonths?)


then


[date] >= _add_months(?pDate?, ?pMonths? * -1)


Ah, bdbits got there first with a more concise answer :)

sanchoniathon

Thank you all ... simple comma that i needed to replace by a semiolon ( ; )