Unpivot columns of cube for SSRS report - reporting-services

I need to modify a report that has a ton of fields to pivot some columns. It uses a SSAS cube. I don't know MDX and learning it for this task isn't really feasible.
Example: Existing
Date Amount SalesPerson1 Salesperson2 Manager 1 Product nbr
4/1/15 100 JSMtih JDoe TPrice 99
New Results
Participant Participant Role Date Amount Product Nbr
JSmith SalesPerson1 4/1/15 100 99
JDOE Salesperson2 4/1/15 100 99
TPRice Manager1 4/1/15 100 99
I could rewrite the report using SQL and do an UNPIVOT (I did write the query), but to reconstruct the report would be a ton of work (it has around 10 cascading parameters, sections that collapse/expand, etc.)
Is modifying the MDX to unpivot some columns easy? I couldn't find an unpivot for MDX and I am guessing it is just inherent in MDX.
MDX Code:
SELECT
NONEMPTY({
[Measures].[Outstanding Balance],
[Measures].[TM Fee],
[Measures].[Upfront Fee],
[Measures].[Non Recurring Fee],
[Measures].[Recurring Fee],
[Measures].[Syndication Fee],
[Measures].[Recap Fee],
[Measures].[International Fee],
[Measures].[Total Deposits Expected],
[Measures].[ACE],
[Measures].[Commitments],
[Measures].[Swap Fee],
[Measures].[Global Commitment],
[Measures].[Loan Fundings Expected One],
[Measures].[Loan Fundings Expected Two],
[Measures].[Change Amount],
[Measures].[Total Fees],
[Measures].[Private Balance]
}) ON COLUMNS,
NONEMPTY ({(
[Account].[Account Number].[Account Number].ALLMEMBERS *
[Account].[Non Accrual Flag].[Non Accrual Flag].ALLMEMBERS *
[Deal].[Deal ID].[Deal ID].ALLMEMBERS *
[Deal].[Hierarchy Type].[Hierarchy Type].ALLMEMBERS *
[Deal].[Officer One].[Officer One].ALLMEMBERS *
[Deal].[Officer Two].[Officer Two].ALLMEMBERS *
[Deal].[Other Competing Banks].[Other Competing Banks].ALLMEMBERS *
[Deal].[Winning Bank].[Winning Bank].ALLMEMBERS *
[Deal].[Officer Three].[Officer Three].ALLMEMBERS *
[Deal].[Group].[Group].ALLMEMBERS *
[Deal].[Competitor One].[Competitor One].ALLMEMBERS *
[Deal].[Incumbentbank].[Incumbentbank].ALLMEMBERS *
[Deal].[Competitor Two].[Competitor Two].ALLMEMBERS *
[Deal].[New Target Market].[New Target Market].ALLMEMBERS *
[Deal].[Approval Description].[Approval Description].ALLMEMBERS *
[Deal].[Loan Disposition].[Loan Disposition].ALLMEMBERS *
[Deal].[Process Center].[Process Center].ALLMEMBERS *
[Deal].[Process Job].[Process Job].ALLMEMBERS *
[Deal].[Deal Type].[Deal Type].ALLMEMBERS *
[Deal].[Screener].[Screener].ALLMEMBERS *
[Deal].[Part Or Synd].[Part Or Synd].ALLMEMBERS *
[Deal].[Department].[Department].ALLMEMBERS *
[Deal].[Party Package Id].[Party Package Id].ALLMEMBERS *
[Deal].[Stage].[Stage].ALLMEMBERS *
[Deal].[Stage Date].[Stage Date].ALLMEMBERS *
[Deal].[Referral].[Referral].ALLMEMBERS *
[Deal].[Deal NAICS Code].[Deal NAICS Code].ALLMEMBERS *
[Deal].[Document Type].[Document Type].ALLMEMBERS *
[Deal].[Internal Referral].[Internal Referral].ALLMEMBERS *
[Deal].[External Referral].[External Referral].ALLMEMBERS *
[Deal].[Referral Category].[Referral Category].ALLMEMBERS *
[Deal].[Underwriter].[Underwriter].ALLMEMBERS *
[Deal].[Product Partner1].[Product Partner1].ALLMEMBERS *
[Deal].[Product Partner2].[Product Partner2].ALLMEMBERS *
[Deal].[Manager1].[Manager1].ALLMEMBERS *
[Deal].[Manager2].[Manager2].ALLMEMBERS *
[Deal].[Other Participant].[Other Participant].ALLMEMBERS *
[Deal].[Agent].[Agent].ALLMEMBERS *
[Deal].[Deal Source].[Deal Source].ALLMEMBERS *
[Deal].[Target Market Client].[Target Market Client].ALLMEMBERS *
[Deal].[Reason].[Reason].ALLMEMBERS *
[Deal].[Client Status As Of Deal Input].[Client Status As Of Deal Input].ALLMEMBERS *
[Deal].[Source System].[Source System].ALLMEMBERS *
[Deal].[Stage ID].[Stage ID].ALLMEMBERS *
[Deal].[ABLBDO].[ABLBDO]. ALLMEMBERS *
[Party].[Customer Number].[Customer Number].ALLMEMBERS *
[Party].[Party NAICS Code].[Party NAICS Code].ALLMEMBERS *
[Party].[Party Name].[Party Name].ALLMEMBERS *
[Party].[Name].[Name].ALLMEMBERS *
[Product].[Product Type Number].[Product Type Number].ALLMEMBERS *
[Product].[CB Description].[CB Description].ALLMEMBERS *
[Service Transaction].[Service Transaction Key].[Service Transaction Key].ALLMEMBERS *
[Service Transaction].[Expected Funding Date Two].[Expected Funding Date Two].ALLMEMBERS *
[Service Transaction].[Expected Funding Date One].[Expected Funding Date One].ALLMEMBERS *
[Service Transaction].[Gross Revenue Date].[Gross Revenue Date].ALLMEMBERS *
[Service Transaction].[Loan Action].[Loan Action].ALLMEMBERS *
[Service Transaction].[Queue Creation Date].[Queue Creation Date].ALLMEMBERS *
[Service Transaction].[Loan Open Date].[Loan Open Date].ALLMEMBERS *
[Service Transaction].[Comments].[Comments].ALLMEMBERS *
[Service Transaction].[Next Maturity Date].[Next Maturity Date].ALLMEMBERS *
[Service Transaction].[Creation Date].[Creation Date].ALLMEMBERS *
[Service Transaction].[Total Loan Fundings Expected].[Total Loan Fundings Expected].ALLMEMBERS *
[Service Transaction].[Risk Rating].[Risk Rating].ALLMEMBERS *
[Service Transaction].[Last Modified On].[Last Modified On].ALLMEMBERS *
[Service Transaction].[Revenue].[Revenue].ALLMEMBERS *
[Service Transaction].[Note Rate].[Note Rate].ALLMEMBERS *
[Service Transaction].[RLOC Stock UDF].[RLOC Stock UDF].ALLMEMBERS *
[Service Transaction].[Basis Points].[Basis Points].ALLMEMBERS *
[Service Transaction].[Pricing Index].[Pricing Index].ALLMEMBERS *
[Service Transaction].[Law Firm].[Law Firm].ALLMEMBERS *
[Service Transaction].[Cost Center].[Cost Center].ALLMEMBERS *
[Service Transaction].[Expected Funding Date].[Expected Funding Date].ALLMEMBERS *
[Service Transaction].[Year].[Year].ALLMEMBERS *
[Service Transaction].[Estimated Closing Date].[Estimated Closing Date].ALLMEMBERS *
[Service Transaction].[Expected Funding Month].[Expected Funding Month].ALLMEMBERS *
[Service Transaction].[Expected Deposit Funding Date].[Expected Deposit Funding Date].ALLMEMBERS *
[Pipeline Dates].[Approved Date].[Approved Date].ALLMEMBERS *
[Pipeline Dates].[Closed Date].[Closed Date].ALLMEMBERS *
[Pipeline Dates].[Declined Date].[Declined Date].ALLMEMBERS *
[Pipeline Dates].[Discussion Date].[Discussion Date].ALLMEMBERS *
[Pipeline Dates].[Documentation Date].[Documentation Date].ALLMEMBERS *
[Pipeline Dates].[Lost Date].[Lost Date].ALLMEMBERS *
[Pipeline Dates].[PAR Date].[PAR Date].ALLMEMBERS *
[Pipeline Dates].[Proposal Date].[Proposal Date].ALLMEMBERS *
[Pipeline Dates].[Suspended Date].[Suspended Date].ALLMEMBERS *
[Pipeline Dates].[Term Sheet Date].[Term Sheet Date].ALLMEMBERS *
[Pipeline Dates].[Underwriting Date].[Underwriting Date].ALLMEMBERS *
[Pipeline Dates].[Withdrawn Date].[Withdrawn Date].ALLMEMBERS
)}) DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM (
SELECT ( STRTOSET(#DealDocumentType, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealDealType, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#ProductProductDescription, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealNonPrimaryOfficer, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealOfficerOne, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealClientStatusAsOfDealInput, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#ServiceTransactionCostCenter, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealGroup, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#ClosingDateCalendar, CONSTRAINED) ) ON COLUMNS FROM (
SELECT ( STRTOSET(#DealStage, CONSTRAINED) ) ON COLUMNS FROM [Pipeline]
)
)
)
)
)
)
)
)
)
)

You could use UNION to get a set with all the people in the same column.
But that maybe not produce the same results you want.
You would be getting the "Totals" for Manager1 and Manager2. Give it a try.
WITH
SET myPeople
AS
UNION(
[Deal].[Manager1].[Manager1].ALLMEMBERS,
[Deal].[Manager2].[Manager2].ALLMEMBERS,
[Deal].[Agent].[Agent].ALLMEMBERS
)

I would start with the following:
Download & install OLAP PivotTable Extensions from https://olappivottableextend.codeplex.com/
Open Excel and connect to your Cube
Build your query/report using drag and drop attributes.
Use plugin to copy the required MDX Query and edit as required.

Related

Error in WITH RECURSIVE while troubleshooting hacker rank

Summary HackerRank Problem
(1) Draw Triangle 1
P(5) :
* * * * *
* * * *
* * *
* *
*
This is example and i have to make this P(20)
WITH RECURSIVE stars (n,star) AS(
SELECT 39,LEFT('* * * * * * * * * * * * * * * * * * * *',39)
UNION ALL
SELECT n-2,LEFT('* * * * * * * * * * * * * * * * * * * *',n-2)
FROM stars
WHERE n>1
)
SELECT star
FROM stars
I solved question of Draw the Triangle 1 in this way.
(2) Draw Triangle 2
P(5):
*
* *
* * *
* * * *
* * * * *
This is example and i have to make this P(20)
However, this does not work in Draw THE Triangle 2
WITH RECURSIVE stars (n,star) AS(
SELECT 1, LEFT('* * * * * * * * * * * * * * * * * * * *',1)
UNION ALL
SELECT n+2, LEFT('* * * * * * * * * * * * * * * * * * * *',n+2)
FROM stars
WHERE n<38
)
SELECT star
FROM stars
WITH RECURSIVE stars (n,star) AS(
SELECT 1,'*'
UNION ALL
SELECT n+1, CONCAT(star,' *')
FROM stars
WHERE n<20
)
SELECT star
FROM stars
I tried using LEFT() by changing the number just like Triange 1, but the HackerRank site showed a message like 'ERROR 1406 (22001) at line 1: Data too long for column 'star' at row 1' In my personal mysql, I only got OK, but I couldn't see the result table.
If the data is too long and it is an error, shouldn't I meet the same error in the first problem?
Is there something I don't know ?
Take a good look at outputs of queries for "triangle 1" and "triangle 2".
What is the difference? That's right, rows for the "triangle 2" query are in reverse order.
Which value in the query for "triangle 1" defines the order of rows? That's right, it's n.
How can I modify the query for "triangle 1" so that it outputs rows in reverse order? That's right, since the value of n in the first row is 39 and the last one is 1 (the rows are ordered by n in descending order), just reverse rows order by adding ORDER BY n.
So the query for "triangle2" should look like
WITH RECURSIVE stars(n, star) AS(
SELECT 39, LEFT('* * * * * * * * * * * * * * * * * * * *', 39)
UNION ALL
SELECT n-2, LEFT('* * * * * * * * * * * * * * * * * * * *', n-2)
FROM stars
WHERE n > 1
)
SELECT star
FROM stars
ORDER BY n
Just check it

mariadb(mysql) slow query fix

SELECT
CAST(`a`.`selldate` AS DATE) AS `regdate`,
`a`.`market` AS `market`,
`a`.`user_seq` AS `user_seq`,
COUNT(0) AS `complete`,
ROUND(SUM(`a`.`sell`) - SUM(`a`.`buy`) - SUM(`a`.`buy_fee`) - SUM(`a`.`sell_fee`),8) AS `profit`,
ROUND(SUM(`a`.`buy`),8) AS `price`,
ROUND(SUM(`a`.`sell_fee`),8) AS `sell_fee`,
ROUND(SUM(`a`.`buy_fee`),8) AS `buy_fee`,
(
SELECT SUM(`yangpago`.`funding`.`price`) AS `funding_fee`
FROM `yangpago`.`funding`
WHERE
DATE_FORMAT(FROM_UNIXTIME(`yangpago`.`funding`.`time`),'%Y-%m-%d') = CAST(`a`.`selldate` AS DATE)
AND
`yangpago`.`funding`.`user_seq` = `a`.`user_seq`
GROUP BY `regdate`,`yangpago`.`funding`.`user_seq`
) AS `funding_fee`
FROM (
SELECT
`v_order`.`cnt` AS `cnt`,
`v_order`.`market` AS `market`,
`v_order`.`user_seq` AS `user_seq`,
`v_order`.`selldate` AS `selldate`,
`v_order`.`sell_price` * `v_order`.`sell_amount` AS `sell`,
`v_order`.`buy_price` * `v_order`.`buy_amount` AS `buy`,
`v_order`.`sell_price` * `v_order`.`sell_amount` * `f`.`sell_fee` AS `sell_fee`,
`v_order`.`buy_price` * `v_order`.`buy_amount` * `f`.`buy_fee` AS `buy_fee`
FROM (`yangpago`.`v_order`
JOIN `yangpago`.`fee` `f`
ON (
`f`.`market` = `v_order`.`market`
AND
`f`.`user_seq` = `v_order`.`user_seq`
AND
CAST(`v_order`.`selldate` AS DATE) BETWEEN `f`.`startdate`
AND
IFNULL(`f`.`enddate`, CURRENT_TIMESTAMP())
)
)
WHERE `v_order`.`state` = 'COMPLETE') `a`
GROUP BY CAST(`a`.`selldate` AS DATE),`a`.`market`,`a`.`user_seq`
here is my balance view query.
this query is speed very slow. run time (1~2s)
i try funding subquery remove and check time 0.2s~0.3s
so, remove join query too. and check time 0.1s
all of sum column remove, time is 0.004s. i want 0.01s under. this query result.
how to fix it?
You are in effect reading the data twice once to create the virtual table a then again to aggregate - the virtual table is not necessary consider refactoring your code
SELECT
CAST(v_order.selldate AS DATE) AS regdate,
v_order.market AS market,
v_order.user_seq AS user_seq,
COUNT(0) AS complete,
sum(v_order.sell_price * v_order.sell_amount) -
SUM(v_order.buy_price * v_order.buy_amount) -
SUM(v_order.buy_price * v_order.buy_amount * f.buy_fee) -
SUM(v_order.sell_price * v_order.sell_amount * f.sell_fee) as profit,
SUM(v_order.buy_price * v_order.buy_amount) AS price,
SUM(v_order.sell_price * v_order.sell_amount * f.sell_fee) AS sell_fee,
SUM(v_order.buy_price * v_order.buy_amount * f.buy_fee) AS buy_fee,
(SELECT SUM(funding.price) AS funding_fee
FROM funding
WHERE DATE_FORMAT(FROM_UNIXTIME(funding.time),'%Y-%m-%d') = CAST(a.selldate AS DATE)
AND funding.user_seq = v_order.user_seq
) AS funding_fee
FROM v_order
JOIN fee f ON f.market = v_order.market
AND f.user_seq = v_order.user_seq
AND CAST(v_order.selldate AS DATE) BETWEEN f.startdate
AND coalesce(f.enddate, CURRENT_TIMESTAMP())
WHERE v_order.state = 'COMPLETE'
GROUP BY regdate,market,user_seq;

Multiply kg and grams unit with price per kg

I'm currently have a task when I have to calculate the values for the cost of supplies which I have to multiply priceperweight with weight. But in weight there's also kg and grams. When I multiply it, it gives the results like $3000 for 500 grams of Spinach. Here's my scheme. Please help. All help would be appreciated :D Here's my code! Thank you so much
select PricePerWeight * Weight from Supplies;
Normalize the weight to grams or Kg (I'll use grams) using CASE x WHEN y:
SELECT
s.*,
CASE s.metric
WHEN 'Kilos' THEN ( s.weight * 1000 )
WHEN 'grams' THEN ( s.weight * 1 ) ELSE NULL
END AS weightInGrams
FROM
supplies AS s
Then adding additional units is straightforward:
SELECT
s.*,
CASE s.metric
WHEN 'tonnes' THEN ( s.weight * 1000 * 1000 )
WHEN 'Kilos' THEN ( s.weight * 1000 )
WHEN 'grams' THEN ( s.weight * 1 )
WHEN 'jupiter' THEN ( s.weight * 1.9 * POW( 10, 27 ) * 1000 )
WHEN 'lbs' THEN ( s.weight * 453.592 ) ELSE NULL
END AS weightInGrams
FROM
supplies AS s
Assuming you're using ISO-compliant SQL, you'll need to use an outer-query or a CTE to then multiply by pricePerWeight, which I assume is in Kg:
Note that the queries below still use grams as the base unit of mass to avoid problems caused by integer division (as SQL does not make it easy to make sure numeric literals are processed as floats or decimals instead of integers, as integer division truncates rather than rounds).
The final value is the thePrice column in the queries below:
Option 1: Using an outer-query:
SELECT
s2.*,
( s2.pricePerWeight * s2.weightInGrams ) / 1000.00 AS thePrice
FROM
(
SELECT
s.*,
CASE s.metric
WHEN 'tonnes' THEN ( s.weight * 1000 * 1000 )
WHEN 'Kilos' THEN ( s.weight * 1000 )
WHEN 'grams' THEN ( s.weight * 1 )
WHEN 'jupiter' THEN ( s.weight * 1.9 * POW( 10, 27 ) * 1000 )
WHEN 'lbs' THEN ( s.weight * 453.592 ) ELSE NULL
END AS weightInGrams
FROM
supplies AS s
)
Option 2: Using a CTE:
WITH s2 AS (
SELECT
s.*,
CASE s.metric
WHEN 'tonnes' THEN ( s.weight * 1000 * 1000 )
WHEN 'Kilos' THEN ( s.weight * 1000 )
WHEN 'grams' THEN ( s.weight * 1 )
WHEN 'jupiter' THEN ( s.weight * 1.9 * POW( 10, 27 ) * 1000 )
WHEN 'lbs' THEN ( s.weight * 453.592 ) ELSE NULL
END AS weightInGrams
FROM
supplies AS s
)
SELECT
s2.*,
( s2.pricePerWeight * s2.weightInGrams ) / 1000.00 AS thePrice
FROM
s2

MySQL using `IN` while having multiple values

I am trying to count of coupons sold by each store from the list of stores within 20 miles range. I know the following syntax will work if there is only 1 store.
SELECT sum(couponscount) as count where restaurant IN (SELECT storename where bhal bhal bhal and output is one value)
What is I the IN (SELECTstorenamewhere bhal bhal bhal and output is multiple values) will return multiple values?
Like in my case the complete SQL is like and its not working
SELECT sum(couponscount) as count FROM `coupons` having `restaurant` IN (SELECT `storename`, ((ACOS(SIN(-27.561264299999998 * PI()/180) * SIN(latitude * PI()/180) + COS(-27.561264299999998 * PI()/180) * COS(latitude * PI()/180) * COS((153.07304890000003 – longitude) * PI()/180)) *180 / PI( )) *60 * 1.1515) AS `distance` FROM `stores` WHERE `status`=’active’ HAVING `distance` <=20)
Is there anyway to make it working?
SELECT sum(couponscount) AS COUNT,restaurant
FROM `coupons`
WHERE `restaurant` IN
(SELECT `storename`
FROM `stores`
WHERE `status`='active'
AND
((ACOS(SIN(-27.561264299999998 * PI()/180) * SIN(latitude * PI()/180) + COS(-27.561264299999998 * PI()/180) * COS(latitude * PI()/180) * COS((153.07304890000003 – longitude) * PI()/180)) *180 / PI()) *60 * 1.1515) <=20)
GROUP BY restaurant
Also use proper quotes for active.
Presumably, you want to get the count of coupons from stores within a distance of 20. Moving the having condition to a where clause should do what you want:
SELECT sum(couponscount) as count
FROM `coupons`
WHERE `restaurant` IN (SELECT `storename`
FROM `stores`
WHERE `status` = 'active' AND
((ACOS(SIN(-27.561264299999998 * PI()/180) * SIN(latitude * PI()/180) + COS(-27.561264299999998 * PI()/180) * COS(latitude * PI()/180) * COS((153.07304890000003 – longitude) * PI()/180)) *180 / PI( )) *60 * 1.1515) <= 20
);
You had a major syntax problem because your subquery returned two columns. When you use a subquery with in, you can only return one column, in this case, storename. I moved the code for the distance calculation to the where clause. No having clause is needed either in the subquery or the outer query.

Error adding new column

I'm trying to add an "account subcategory" column to my report using the query builder.
I added the column and got the error message:
"An MDX expression was expected. An empty expression was specified."
How do I format the MDX in order to get the result I am looking for?
I posted the code below. Hope this helps.
SELECT NON EMPTY { [Measures].[Order Partic Adj], [Measures].[PY Net Cash], [Measures].[Order Merch Adj], [Measures].[OCCURS - APY BOOKING FACT], [Measures].[PY Orders], [Measures].[Net Cash Merch Adj], [Measures].[Net Cash Acq Adj], [Measures].[Total Proj Orders], [Measures].[Order Acq Adj], [Measures].[Net Cash Partic Adj], [Measures].[Total Proj Net Cash] } ON COLUMNS, NON EMPTY { ([Current Assignment].[Territory Code].[Territory Code].
ALLMEMBERS * [Current Assignment].[Sales Rep Name Caps].[Sales Rep Name Caps].
ALLMEMBERS * [Current Assignment].[Sales Rep Employee Code].[Sales Rep Employee Code].
ALLMEMBERS * [Account].[Account Subcategory Name].[Account Subcategory Name].
ALLMEMBERS * [Account].[ACCOUNT NAME].[ACCOUNT NAME].
ALLMEMBERS * [Account].[LIFETOUCH ID].[LIFETOUCH ID].
ALLMEMBERS * [Account].[NACAM Ordered].[NACAM Ordered].
ALLMEMBERS * [Account].[ENROLLMENT COUNT].[ENROLLMENT COUNT].
ALLMEMBERS * [Account].[STATE].[STATE].
ALLMEMBERS * [Account].[District Name].[District Name].
ALLMEMBERS * [Account].[City].[City].
ALLMEMBERS * [Account].[COUNTY].[COUNTY].
ALLMEMBERS * [APY].[BOOKING STATUS].[BOOKING STATUS].
ALLMEMBERS * [APY].[X BOOKING STATUS ID].[X BOOKING STATUS ID].
ALLMEMBERS * [APY].[AT RISK IND].[AT RISK IND].
ALLMEMBERS * [APY].[INCENTIVE ACQUISITION IND].[INCENTIVE ACQUISITION IND].
ALLMEMBERS * [APY].[CY BOOKING CAMERA TYPE NAME].[CY BOOKING CAMERA TYPE NAME].
ALLMEMBERS * [APY].[CURRENT YEAR SELLING METHODS].[CURRENT YEAR SELLING METHODS].
ALLMEMBERS * [APY].[PY ACTUAL CAMERA TYPE NAME].[PY ACTUAL CAMERA TYPE NAME].
ALLMEMBERS * [APY].[ACQUIRED BUSINESS NAME].[ACQUIRED BUSINESS NAME].
ALLMEMBERS * [APY].[PRIOR YEAR SELLING METHODS].[PRIOR YEAR SELLING METHODS].
ALLMEMBERS * [Marketing].[SUB PROGRAM NAME].[SUB PROGRAM NAME].
ALLMEMBERS * [Current Assignment].[AMS Business Unit Name].[AMS Business Unit Name].
ALLMEMBERS * [Account].[POSTAL CODE].[POSTAL CODE].
ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOSET(#APYBOOKINGSTATUS, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentSalesRepNameCaps, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentTerritoryCode, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentRegionName, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentAreaName, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentAMSBusinessUnitName, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#CurrentAssignmentCountryName, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#SchoolYearSCHOOLYEAR, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(#MarketingSUBPROGRAMNAME, CONSTRAINED) ) ON COLUMNS FROM [BO_APY_Booking_Fact_Full]))))))))) WHERE ( IIF( STRTOSET(#SchoolYearSCHOOLYEAR, CONSTRAINED).Count = 1, STRTOSET(#SchoolYearSCHOOLYEAR, CONSTRAINED), [School Year].[SCHOOL YEAR].currentmember ), IIF( STRTOSET(#CurrentAssignmentCountryName, CONSTRAINED).Count = 1, STRTOSET(#CurrentAssignmentCountryName, CONSTRAINED), [Current Assignment].[Country Name].currentmember ), IIF( STRTOSET(#CurrentAssignmentAreaName, CONSTRAINED).Count = 1, STRTOSET(#CurrentAssignmentAreaName, CONSTRAINED), [Current Assignment].[Area Name].currentmember ), IIF( STRTOSET(#CurrentAssignmentRegionName, CONSTRAINED).Count = 1, STRTOSET(#CurrentAssignmentRegionName, CONSTRAINED), [Current Assignment].[Region Name].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS