指令功能 Cognos 报告

发布于 2024-09-29 10:41:30 字数 320 浏览 1 评论 0原文

我试图在字符串字段中找到@。 Congos 8 中的以下数据项会

0

为每次调用返回。

instr 
(
[email protected], '@', 1
)

有什么想法吗?一般来说,Cognos 和 Oracle 都是新手,但我觉得我必须遗漏一些明显的东西。

I am trying to find the @ in a string field. The follow data item in a Congos 8 returns

0

for every call.

instr 
(
[email protected], '@', 1
)

Any ideas? New to Cognos and Oracle in general but I feel like I have to be missing something obvious.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹏半生如梦愿梦如真 2024-10-06 10:41:30

Cognos 是否有 InStr ?我一直使用 Position 来实现这一点。

再深入一点,就会发现 InStr 是一个 Oracle 函数,但我不确定数据库和 Cognos 之间的相互作用,因为我们只是使用数据库来获取数据,所有用户数据的操作完全由 Cognos 端为我们处理。

但是,即使这工作正常,在我看来你的第一个论点也应该被引用,是吗?毕竟它应该是一个字符串。

Does Cognos even have an InStr? I've always used Position for this.

A little more digging reveals InStr as an Oracle function but I'm not sure on the interplay between the database and Cognos since we just use the database for getting data, all user manipulations of the data are handled purely on the Cognos side for us.

But, even if that worked properly, it seems to me that your first argument should be quoted as well, yes? It is supposed to be a string after all.

心清如水 2024-10-06 10:41:30

如果您只是想知道那里是否有@符号,您可以执行以下操作(此处它会出现在过滤器中):

[Business View].[Student Demographics (by Semester)].[Student Name] CONTAINS 'Z'

如果您想要@的位置作为一个值来执行某些操作,您可以可以做这样的事情(这里它会出现在数据项表达式中):

position( 'Z', [Business View].[Student Demographics (by Semester)].[Student Name] )

请注意,您要查找的值需要首先出现,您要查找的字符串其次出现。

If you just want to know if there is an @ sign in there, you can do something like this (here as it would appear in a filter):

[Business View].[Student Demographics (by Semester)].[Student Name] CONTAINS 'Z'

If you want the position of the @, as a value to do something with, you can do something like this (here as it would appear in a Data Item Expression):

position( 'Z', [Business View].[Student Demographics (by Semester)].[Student Name] )

Note that the value you're looking for needs to appear first, the string you're looking in second.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文