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

Extracting equation from a data field to create data item

Started by ccbarbeau, 13 Aug 2013 09:10:11 AM

Previous topic - Next topic

ccbarbeau

Morning,

I am using a table in a DB2 database that has the following format:

Sequence            Description            Equation
      1                    123456                 ([LINE] *EQ "XXX" & [PRODUCT]=%VALUES(01 02 03 04 05))

What I am trying to acheive is to extract the equation field to create a new data item that would return the description. ie, if line = XXX and Product = 01, then the data item would return 123456.

Thought? I'd really like to avoid writing 125 different IF statements. Plus, the table is dynamic, and I am not made aware of changes to it. Those multiple IFs would require monthly double-checking, which if not efficient to say the least.

Many thanks.

blom0344

This makes little sense.. You want the value of description returned that is stored within the table column 'description'  Where do you need the equation for ?
Can you clarify ?

ccbarbeau

I must admit this is not the clearest post. I'll try again.

The table contains information that is updated by another department. I need to extract the data in the description field to use as a filter. I don't want to write a giant filter manually, because there are about 150 lines in the table and they are subject to change without my being advised.

blom0344

Something like:

Select Description from sometable where equation like '%XXX%' and equation like '%01%'

This may return 0, 1 or more than one result. Now, if the where part of the above query is fixed (no changes) then you can code it. To use it as a filter, you could wrap it in its own query subject with crossjoins allowed in report, or better still define a mandatory prompt with this as the prompt query. The prompt parameter then holds the value of the returned description, to be use within other queries as a filter.
Point is, how do you know exactly 1 result is returned and is the where clause static or also dynamic?