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

Merge data in one data item

Started by backhandx, 28 Jun 2016 10:19:56 AM

Previous topic - Next topic

backhandx

Hi all,
I have to display 10 last records in a column chart. I have also to compute the forecast of the next 4 weeks based on the 10 last data. Then I have to merge the 10 last records with the 4 computed data in the same data item but I don't know to achieve this. Can anyone help me ?

Thanks

sdf

is your source relational or dimensional?
first thought would be to use Set().

but we need to fully understand your requirements.

backhandx


BigChris

To get the last 10 records you're probably going to be using a rank() function in your filter.

Once you've done your calculations, are you expecting to get one record with 50 fields concatenated (10 original fields plus 10 * 4 forecast fields)? Or are you expecting 10 records, each with 5 fields contenated?

backhandx

Thank you for your reply!
Assume I have a data item 'C' with 20 records: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
I want to have a data item with the first 10 records of the column C (in my exemple: [1 2 3 4 5 6 7 8 9 10]) plus one record which is the average of this first 10 records ( In my exemple: 5.5= (1+2+3+4+5+6+7+8+9+10)/10) Then I concatenate the two data item in one like this [5.5 1 2 3 4 5 6 7 8 9 10]. I hope the exemple is clear.
Thanks

hespora

If I understand correctly, as in, you don't want concatenation, but you want your data item which has 10 values to have 11 values when you're done, then that's a UNION query.

Query1: your original query containing the 10 records
Query2: a query calculating, in your example, the average of those 10 records, but it will have only one resulting line

now you create queries 3 and 4, which you point to queries 1 and 2 respectively, rather than your data source. You do this in order to a) manage the data items, which need to be the same in both queries 3 and 4, and b) to get rid of multiple records from the data source (if you do any aggregations in queries 1 and 2, which you do, at least in 2).

Now you pull in the UNION-entry from the toolbox in query explorer. This will create Query5, to which you need to assign both queries 3 and 4.

sdf

In my understanding you have item 'C' which holds 10 last records.
Then 4 calculated data which you intend to include in item 'C' making your record 14 items.

You'll be needing union as stated by hespora and be creating an item which holds the 14 items together.