FileExists function returns 1 even when file is not present

Post Reply
amit_hhh
Posts: 28
Joined: Wed Jan 18, 2017 3:27 pm
OLAP Product: Cognos TM1
Version: 10.2.2, 11
Excel Version: Excel2010
Location: Bangalore, India

FileExists function returns 1 even when file is not present

Post by amit_hhh »

Hi,
I am facing a strange issue in TI where FileExists function returns 1 even when the file is not present in the specified directory. It returns 1 also when the file is present.
Not sure why it is happening and it is causing TI logic to fail. Please suggest.
Thanks!
Regards,
Amit Saxena
India
bgregs
Posts: 77
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: FileExists function returns 1 even when file is not present

Post by bgregs »

Hi!

Would you be able to post the code that is encountering the error? If you have a variable that is holding the file path, could you also post the declaration of that as well? The more the better! :D
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: FileExists function returns 1 even when file is not present

Post by lotsaram »

amit_hhh wrote: Tue Jan 08, 2019 5:38 pm Hi,
I am facing a strange issue in TI where FileExists function returns 1 even when the file is not present in the specified directory. It returns 1 also when the file is present.
Not sure why it is happening and it is causing TI logic to fail. Please suggest.
Thanks!
This sounds suspiciously like the code is not doing what you think it is doing. In these cases 99% of the time the code is doing exactly what it has been programmed to do, just the programmer made a mistake. We have all been there. Best to 1/ proof read the code (again) and 2/ follow bgregs suggestion. It you don't post the actual code no one can help.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Post Reply