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

Condition when defining a join relation

Started by backhandx, 15 Feb 2017 05:11:42 AM

Previous topic - Next topic

backhandx

Hi All,
I am wondering if it is possible to define a condition in a join relation.

I have two tables: A(column a, column b) and B(column c).
I want to define 2 join between these two tables depending on the values of the Column c .

If the value of Column c = {x,y} the join between A and B is ( column a <=> column c), otherwise the join between A and B is ( column b <=> column c).

Do you have any idea how to do this in FW?

Thanks in advance.

Lynn

Quote from: backhandx on 15 Feb 2017 05:11:42 AM
Hi All,
I am wondering if it is possible to define a condition in a join relation.

I have two tables: A(column a, column b) and B(column c).
I want to define 2 join between these two tables depending on the values of the Column c .

If the value of Column c = {x,y} the join between A and B is ( column a <=> column c), otherwise the join between A and B is ( column b <=> column c).

Do you have any idea how to do this in FW?

Thanks in advance.

You can click the ellipses next to the relationship expression at the lower right side of the relationship dialog to write more complex join expressions.

It sounds a bit strange to do what you are attempting, however. It is hard to offer alternatives without understanding more about what you need to achieve, but perhaps Table B really has two different roles and ought to be modelled as such?

AnalyticsWithJay

Quote from: backhandx on 15 Feb 2017 05:11:42 AM
If the value of Column c = {x,y} the join between A and B is ( column a <=> column c), otherwise the join between A and B is ( column b <=> column c).

After clicking the ellipsis as Lynn suggested, your new logic would look like this:

( C in ('x','y') AND A = C) OR (B = C) )

backhandx

Quote from: Lynn on 15 Feb 2017 05:52:27 AM
You can click the ellipses next to the relationship expression at the lower right side of the relationship dialog to write more complex join expressions.

It sounds a bit strange to do what you are attempting, however. It is hard to offer alternatives without understanding more about what you need to achieve, but perhaps Table B really has two different roles and ought to be modelled as such?

Actually, we had two tables V( month1, month2, ..) and W(Week1, Week2), these two tables are joined to table A on a and b. The client want to merge table V and W on a table B in order to have one level in a hierarchy with the value of V and W columns. But the problem is that the join between A and B=V +W depends on the member.
Hope It is little bit clear