I have a query that returns data correctly in the IDT universe (SQL Server 2008 database) but when I create a Webi (Rich Client) report for the same query I get no data returned. I created a Dimension object utilizing the @Variable('BOUSER') function in the Where clause to restrict the values returned. Below is the SQL for the object:
SELECT
UserView.ResourceName
FROM
UserView
WHERE
( @Variable('BOUSER') = 'WO' OR
( right(UserView.ResourceNTAccount,{fn length(UserView.ResourceNTAccount)}-6)
) = @Variable('BOUSER') )
This code: @Variable('BOUSER') = 'WO' is used so that I can run the report without any restrictions, but anyone else will be restricted to the values associated with their NT account. The query in the IDT tool works as expected and I get all the values when the query is executed.
However, when I use the same query when creating a Webi (Rich Client) report against the universe I get no data (the query in both cases is simply the one object I provided the code for above). The Webi report does work as expected with any other user. I also copied the SQL from the IDT query and pasted to the WEBI query (custom SQL). Again no data returned, but it works correctly in IDT. I separately verified in Webi using the currentuser() variable to verify that it is picking up my BOUSER correctly. I am just baffled by this.
I can't understand why it works correctly in the IDT query but not the query for Webi which uses the same universe object. Note that this issue seems to be only happening in Webi Rich Client, it works as expected in InfoView.
Anyone know what is happening here?