COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dbahiker on 15 Nov 2017 08:27:59 AM

Title: Running MDX Query to SSAS
Post by: dbahiker on 15 Nov 2017 08:27:59 AM
I have a report using Framework metadata with SSAS cube attached. But I would like to have a new second Query with custom handwritten MDX that would get the last timestamp the cube was ran.
I have this MDX and it works in SSMS but I can't get it to work in Cognos MDX object. I have set the Data Source as what I have in Framework and I set the catalog as cube name.

-- To get the last date of Cube processing
SELECT CUBE_NAME, LAST_DATA_UPDATE FROM $System.MDSCHEMA_CUBES
where CUBE_NAME = 'cubename'
Title: Re: Running MDX Query to SSAS
Post by: dbahiker on 15 Nov 2017 08:29:21 AM
Screenshot from cognos
Title: Re: Running MDX Query to SSAS
Post by: Lynn on 15 Nov 2017 10:10:34 AM
Can you use a layout calculation with the report function to get this information? I don't know if it only works with PowerCubes but thought I'd mention it in case.

Quote
CubeDataUpdatedOn ( dimension )

Returns the date time that data in the cube was last updated. "Dimension" specifies from which cube to retrieve the metadata.
Title: Re: Running MDX Query to SSAS
Post by: dbahiker on 15 Nov 2017 10:23:18 AM
Yep that works on a SSAS Cube too. Thanks!