COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: fml55555 on 13 May 2014 04:47:51 PM

Title: Want to display values for two queries in the same chart
Post by: fml55555 on 13 May 2014 04:47:51 PM
Hi gurus,

I am trying to build a Bar chart where one of the bars is populated from one query and the second one from a second query. I have tried to union them and use the union but it fails with error messages (attached).

Query 1

Gets input for month year from a user (this is done by a macro in the slicer) and calculates a measure

Query
Uses the macro and lag function to build the same measure value for previous period


eg. if query 1 builds
revenue for
feb/2014
query 2 builds revenue for
Feb/2013

I am not sure how to proceed from here
Title: Re: Want to display values for two queries in the same chart
Post by: Francis aka khayman on 13 May 2014 09:05:10 PM
you don't need a union since you are using dimensional. you just need to build a set..


set([input from user];lag([input from user];1);lag([input from user];2))
Title: Re: Want to display values for two queries in the same chart
Post by: fml55555 on 14 May 2014 10:56:44 AM
Thanks a ton Khayman! It is working... :)