if else 用于业务对象中的字符串类型
如何在业务对象中使用 if...else 作为字符串?我的问题是我的查询返回字符串中的值,其中可能包含重复项。对于重复项,我想做的是查找是否有重复项,如果找到,则仅使用一个。我可以对浮点类型执行此操作,如下所示: If [sales_rev]>1000 then [high_rev] 但如果我这样做 If [display_name]=['sth'] Then....,我总是收到错误。
How can I use if...else in Business Objects for strings? My problem is my query returns value in string which can contain duplicates. For duplicates, what I would like to do is find if I have duplicates or not and if found, just use one. I can do it for float type as like this: If [sales_rev]>1000 Then [high_rev] but if I do If [display_name]=['sth'] Then...., I always get an error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
If [display_name]="sth" Then....
不带方括号并带双引号
Try
If [display_name]="sth" Then....
without square brackets and with double quotes
根据您的问题,我不太确定,但听起来您正在尝试分配一个字符串值而不是比较它。根据您的语言,对字符串执行布尔逻辑的最常见运算符是“==”,而您的问题中只有一个“=”,因此可能是 [display_name]==['sth'] 基于你所说的。
I'm not too sure based on your question, but it sounds like you're trying to assign a string value instead of compare it. Depending on your language, the most common operator to do boolean logic on strings is "==" while you just have a single "=" in your question so it'd probably be [display_name]==['sth'] based on what you stated.