简体   繁体   English

COGNOS使查询主题之间的连接成为条件

[英]COGNOS make the join conditional between query subjects

In COGNOS, when I create a 1...1 relationship between 2 query subjects A and B, is the relationship always in effect? 在COGNOS中,当我在2个查询主题A和B之间创建1 ... 1关系时,这种关系是否始终有效? Or is there a way to say only force the relationship when I am querying A, but when I query B, give me all records from B and ignore A. 或者有一种方法可以说当我查询A时只强制关系,但当我查询B时,给我B的所有记录并忽略A.

This is important because for me, B is a prompt query subject based on a lookup table. 这很重要,因为对我来说,B是基于查找表的快速查询主题。 so let us say A is a list of all customers and B is a lookup table for Status(Active/Inactive). 所以让我们说A是所有客户的列表,B是状态(活动/非活动)的查找表。
When I query B, I just want to see Active/Inactive as prompt values. 当我查询B时,我只想将Active / Inactive视为提示值。 I select Active and it should bring me only records from A with Active Status. 我选择Active,它应该只给我带有活动状态的A记录。

Is this possilbe? 这可能吗?

Cognos uses minimized SQL as default. Cognos使用最小化的SQL作为默认值。 You can read on it in here: 你可以在这里阅读:
Cognos - What Is Minimized SQL? Cognos - 什么是最小化的SQL?

What it basically means is that Cognos picks only the required fields in the SELECT statement. 它基本上意味着Cognos只选择SELECT语句中的必需字段。
So, if you picked for prompt values fields from table B, it will only use (for Prompt page only) table B. 因此,如果您从表B中选择了提示值字段,它将仅使用(仅用于提示页面)表B.
When you execute the report assuming you have values from both table A and B, it will do the join 当您执行报告时,假设您有来自表A和B的值,它将执行连接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM