Hi,
I have been trying to use an IF function in a calculation section but I keep getting a syntax error saying ; missing left parenthesis.
Can anybody help me solve this?
Thanks
IF statements in Cognoscenti Insight
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: IF statements in Cognoscenti Insight
If you post your code people will be able to tell you what is wrong with it.
Declan Rodger
-
- Posts: 95
- Joined: Mon Jun 25, 2012 6:58 am
- OLAP Product: TM1, SSAS, Power BI
- Version: 10.2.2
- Excel Version: 2016
Re: IF statements in Cognoscenti Insight
Can you please post the code you're trying to get working?Jwreford wrote:Hi,
I have been trying to use an IF function in a calculation section but I keep getting a syntax error saying ; missing left parenthesis.
Can anybody help me solve this?
Thanks
Thanks,
Kaz
Kaz
-
- Posts: 3
- Joined: Wed Jan 29, 2014 1:14 pm
- OLAP Product: Cognos insight
- Version: Insight
- Excel Version: 2013
Re: IF statements in Cognoscenti Insight
Hi,
Sorry it would not let me post earlier, here is the code,
if(['ABS ERROR']=0,1,if(&(['ABS ERROR']>0,['FORECAST']=0,(1-['ABS ERROR']/['FORECAST']))
Thanks,
Joe
Sorry it would not let me post earlier, here is the code,
if(['ABS ERROR']=0,1,if(&(['ABS ERROR']>0,['FORECAST']=0,(1-['ABS ERROR']/['FORECAST']))
Thanks,
Joe
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: IF statements in Cognoscenti Insight
Try:Jwreford wrote:Hi,
Sorry it would not let me post earlier, here is the code,
if(['ABS ERROR']=0,1,if(&(['ABS ERROR']>0,['FORECAST']=0,(1-['ABS ERROR']/['FORECAST']))
Thanks,
Joe
Code: Select all
['Destination']=N: If ( ['ABS ERROR'] =0, 1, If ( ( ['ABS ERROR'] > 0 ) & ( ['Forecast'] =0 ), 1- ( ['ABS ERROR'] \ ['FORECAST'] ), 0 ) );
Declan Rodger
-
- Posts: 3
- Joined: Wed Jan 29, 2014 1:14 pm
- OLAP Product: Cognos insight
- Version: Insight
- Excel Version: 2013
Re: IF statements in Cognoscenti Insight
Hi Declan,
Thanks for the above to look like this
['IM ACC DATA Measures':'ACCURACY %']=N:If;(['ABS ERROR']=0,1,If((['ABS ERROR']>0)&(['Forecast']=0),0,1-(['ABS ERROR']\['FORECAST']));
But I get the message =N:if; missing semicolon
Thanks,
Joe
Thanks for the above to look like this
['IM ACC DATA Measures':'ACCURACY %']=N:If;(['ABS ERROR']=0,1,If((['ABS ERROR']>0)&(['Forecast']=0),0,1-(['ABS ERROR']\['FORECAST']));
But I get the message =N:if; missing semicolon
Thanks,
Joe
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: IF statements in Cognoscenti Insight
Not sure where you gained the extra semicolon from but you need to take it out. I also missed a bracket from the end of the code i provided.Jwreford wrote:Hi Declan,
Thanks for the above to look like this
['IM ACC DATA Measures':'ACCURACY %']=N:If;(['ABS ERROR']=0,1,If((['ABS ERROR']>0)&(['Forecast']=0),0,1-(['ABS ERROR']\['FORECAST']));
But I get the message =N:if; missing semicolon
Thanks,
Joe
Code: Select all
['IM ACC DATA Measures':'ACCURACY %']=N:If(['ABS ERROR']=0,1,If((['ABS ERROR']>0)&(['Forecast']=0),0,1-(['ABS ERROR']\['FORECAST'])));
Declan Rodger