Search code examples
cognoscognos-bicognos-11

Edit an uploaded file in Cognos


Using Cognos Analytics 11.1.7IF8

I uploaded a *.xlsx file into Cognos and moved it to where I want it under Team Content. After noticing some problems, I added a column to the spreadsheet to identify the problem data, cleaned up the file, then used the "Replace file" option to upload the revised file. Realizing I had included my check column, I removed the unneeded column from the spreadsheet and tried "Replace file" again. Now it fails with...

MSR-UPL-2122 Unable to refresh file "Filename.xlsx". MSR-UPL-2119 Sheet "Sheet1" is missing column "DataCheck".

The uploaded file is used by a data module that is used by a report. This extraneous column is not used anywhere.

How can I remove a column from an uploaded *.xlsx file? Do I need to delete the file and re-upload it? Won't that give it a new storeid and break the data module?


Solution

  • Use of uploaded files can be tricky as you end up being your own DBA of sorts. In this case the removal of the column is too challenging to seamlessly replace the old uploaded file. As a result you will need to choose the replace file option. Adding columns is a bit less stressful.

    Replacing the old file with a new one should not break the data module. If you look at the module metadata network call in your browser's developer tools (or, if you have the SDK, via the get module metadata REST endpoint) you will see in the use section that the file is identified by the store ID and the path to the location where the file is stored. The file path should be sufficient to allow the module to find the file.

    You will probably get a validation error complaining that the column which you removed is missing. You should be able to deal with that by deleting it from the query subject in the module.

    You can also try the relink functionality in the sources slide out. It's the icon which doesn't see to symbolize anything, which kind of defeats the purpose of an icon, which is to be a symbolic representation of something, on the left-hand side of the browser.