Blog

‘python’ is not recognized as an internal or external command, operable program or batch file.

when trying to access python from command line- we might get an error when we use – ‘python’. Use ‘py’ instead of ‘python’

C:\Users\tekjedi>python
‘python’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\tekjedi>python
Python 3.1(v……] on win32

if you are still getting error then check “environment variables”. You need to add python installed folder path at environment variables.
if your python install path is : C:\Programs\Python\Python37-32 then go to control panel, systems–> Advanced system settings –> Advanced tab –> Environment variables –> System Variables –> Path edit –> at variable name enter your python installation path with “;” i.e. “;C:\Programs\Python\Python37-32;” . hit ok.

Key words for search:
python-is-not-recognized-as-an-internal-or-external-command

replace char(13) char(10)

char(13) is carriage return and char(10) is line feed. Different text editors/viewers will interpret it differently.

Use replace function to get all data in 1 line.
replace(replace(replace(column_name,char(13),’ ‘),char(10),’ ‘), char(9), ‘ ‘)

when copying data which have char(13), char(10) in it to text editor/excel- we notice data showing up in different rows. For this scenario we replace it by ‘ ‘ to get in 1 row.

select ‘a’+char(13)+’b’
select ‘a’+char(10)+’b’

SQL Carriage Returns or Tabs in SQL Server strings

Char(10) – New Line / Line Break

Char(13) – Carriage Return

Char(9) – Tab

cognos drill through from a button/URL link

Had a situation where I need to develop a detail report for a dashboard based on the prompts selected in that dashboard.
Dashboard had multiple summary lists/crosstabs/charts
below are high level steps.

Solution:
1. develop a detail list report based on the same prompts.
2. At master report

  1. create a singleton (on the dashboard where you want to see the url)and say you assigned it to query – q_detail.
  2. Create a data item say “Detail data” and with value “click for detail data”
  3. now add this data item to the singleton you created.
  4. select the data item in the singletom and select drill-Through definitions.
  5. select required report and other options. At parameters click on edit sign and use
  6. “Pass parameter value” and select associated prompt name.
  7. click ok.

now when you run the summary report you should see a link “click for detail data”

Convert multiple rows to single column

To convert multiple rows to single column.

 

At SQL Server database this can be achieved using STUFF function.

The STUFF function inserts a string into another string.

 

Run below queries to get an idea

 

—–Query Start————

create table #temp
(
personid int,
name varchar(10),
subjects varchar(10)
)
;
insert into #temp values(1, ‘mike’, ‘maths’)
insert into #temp values(1, ‘mike’, ‘science’)
insert into #temp values(1, ‘mike’, ‘social’)
insert into #temp values(2, ‘jay’, ‘economics’)
insert into #temp values(2, ‘jay’, ‘history’)
insert into #temp values(3, ‘joe’, ‘maths’)
insert into #temp values(4, ‘kelly’, ‘geography’)
insert into #temp values(4, ‘kelly’, ‘computers’)
insert into #temp values(5, ‘mike’, ‘literature’)
;
select * from #temp

stuff input
;
SELECT personid, name,
subjects = STUFF(
(SELECT ‘, ‘ + b1.subjects FROM  #temp b1 where b1.personid = b2.personid and b1.name = b2.name FOR XML PATH (”)), 1, 1, ”
)
FROM #temp b2   GROUP BY b2.personid, name

stuff output

 

create table #temp
(
personid int,
name varchar(10),
subjects varchar(10)
)
;
insert into #temp values(1, 'mike', 'maths')
insert into #temp values(1, 'mike', 'science')
insert into #temp values(1, 'mike', 'social')
insert into #temp values(2, 'jay', 'economics')
insert into #temp values(2, 'jay', 'history')
insert into #temp values(3, 'joe', 'maths')
insert into #temp values(4, 'kelly', 'geography')
insert into #temp values(4, 'kelly', 'computers')
insert into #temp values(5, 'mike', 'literature')
;
select * from #temp

;
SELECT personid, name,
subjects = STUFF(
(SELECT ', ' + b1.subjects FROM #temp b1 where b1.personid = b2.personid and b1.name = b2.name FOR XML PATH ('')), 1, 1,''
)
FROM #temp b2 GROUP BY b2.personid, name

reference:

https://stackoverflow.com/questions/31211506/how-stuff-and-for-xml-path-work-in-sql-server

Recovering Cognos Framework Manager Models From The Content Store

In this blog post, I will describe the step-by-step recovery of a corrupted or misplaced IBM Cognos Framework Manager model. These steps will create an XML file, then run a report against the package of the lost Framework Manager model or project. This process may be used when the Framework Manager project directory was deleted or lost. It will only recover the model for selected package. Next, as you create a blank new project, the necessary files that are created with this process can be replaced, and using the CQEConfig.xml file, the lost or corrupted Framework Manager model can be retrieved.

This method will work for Cognos 8 and Cognos 10.

In the current Cognos environment, modify the CQEConfig.xml file as shown here:
image1

f the file does not exist in the location above, you can create an XML file with the following content:
image2

Stop the Cognos services and rename the “RTModels” directory to “Original_RTModels”, as shown here:
image3

Now, restart the Cognos services from Cognos Configuration.
Launch Report Studio from Cognos Connection and create a new report using the package for which the model needs to be recovered.

As the report runs, verify that a new “RTModels” folder has been created, as shown. This folder should also contain an XML file, which needs to be used in the next few steps:
image8

Remove the CQEConfig.xml file created in the first step.

Stop the Cognos services.

Now, move the newly created “RTModels” directory to another location (desktop).

Now, rename the “Original_RTModels” folder back to “RTModels” and re-start Cognos services.

Once these steps have been accomplished, in the metadata modeling tool, Framework Manager, create and save a new empty project.

Close this model.

Explore into the folder containing the newly created empty project and change the model.xml file to model.xml.origin.
image11image12

Copy the XML file created in the previous step into the Framework Manager project directory and rename it to model.xml (Note: the model.xml.origin will still exist).

This will enable opening the lost Framework Manager model.

**We can also use CM tools to get this information. Will provide steps when I get some time.

Tags:
Recovering Cognos Framework Manager Models From The Content Store
How to get lost Cognos Framework Manager.
How to Recover a Lost Cognos Framework Manager Model
How to recover a corrupted or lost Framework Manager model.
How to recover a Framework Manager model from the content store
Cognos Framework Manager xml file

Source of the article: http://www.performanceg2.com/recovering-framework-manager-from-content-store/
http://www-01.ibm.com/support/docview.wss?uid=swg21505488