If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

UNION???

Started by Jeka, 08 Jun 2009 12:25:36 PM

Previous topic - Next topic

Jeka

Hi Guys,

Working with a relation model.
Using same dimensions for both queries, except of Date dimension.
1st query uses Transaction Date. with 3 measures + 5 dimensions. It has Date prompt and Location Prompt.
2nd query uses Snapshot date with 5 different measures, same dimensions. It also has Date prompt and Location Prompt.

How can I make both queries to be in the same list table.

I know i can do UNION…. but 2 queries have different number of data items.

Is there any other option....????

Thank you for your input. 

blom0344

Simply use dummy values (for instance zero: 0) where you need them. SQL is very valid with assigning constants in the select :



SELECT DIM1,DIM2, SUM(MEASURE1) AS M1, SUM(MEASURE2) AS M2
FROM TABLE1
GROUP BY DIM1,DIM2
UNION
SELECT DIM1,DIM2, 0,0
FROM TABLE2


is perfectly acceptable