G
Guest
Hi
Query below executes properly, creating a separate column for each drug name, but creates an additiona
block of rows (Stores) for each drug. How can I get just one row for each store, with an entry for each dru
on the same line
Thanks
Mik
Transform Sum(Data.`# of scripts`) AS sumofscript
SELECT DISTINCT Data.`Drug Name`, Panels.Stor
FROM `Cycle 8 Data`.Data Data, `Cycle 8 Data`.Panels Panel
WHERE Panels.Store = Data.`ABS #`
GROUP BY Data.`Drug Name`, Panels.Stor
PIVOT Data.`Drug Name
Sample - Data
STORE DRUG SALE
161 P 15MG
161 R 15MG
161 T 15MG
161 P 30 MG
161 R 30MG
Desired - Outpu
Store P15 R15 T15 P 30 R3
161 5 7 5 9 6
Query below executes properly, creating a separate column for each drug name, but creates an additiona
block of rows (Stores) for each drug. How can I get just one row for each store, with an entry for each dru
on the same line
Thanks
Mik
Transform Sum(Data.`# of scripts`) AS sumofscript
SELECT DISTINCT Data.`Drug Name`, Panels.Stor
FROM `Cycle 8 Data`.Data Data, `Cycle 8 Data`.Panels Panel
WHERE Panels.Store = Data.`ABS #`
GROUP BY Data.`Drug Name`, Panels.Stor
PIVOT Data.`Drug Name
Sample - Data
STORE DRUG SALE
161 P 15MG
161 R 15MG
161 T 15MG
161 P 30 MG
161 R 30MG
Desired - Outpu
Store P15 R15 T15 P 30 R3
161 5 7 5 9 6