Is it possible to use the value for a row from a named calculation as part of the T-SQL for another named calculation?
I am using BIDS to modify a data source view for a SS 2005 SSAS cube I have. I use a named calculation to associate the AccountID to each row in another table:
(SELECT c.ACCOUNTID FROM sysdba.CONTACT c WHERE c.CID ={current-table}.CID)
These calculations run in a few seconds. If I have another named calculation that nests that command, it runs very slow, it takes minutes. An example would be:
(SELECT a.TYPE FROM ACCOUNT a WHERE a.ACCOUNTID = (SELECT c.ACCOUNTID FROM sysdba.CONTACT c WHERE c.CID ={current-table}.CID))
Is there some way to execute something like:
(SELECT a.TYPE FROM ACCOUNT a WHERE a.ACCOUNTID = {current-table}.AccountID)
Obviously, that doesn’t work when I try it. It tells me that it’s an invalid column ID.
Give this a try