cancel
Showing results for 
Search instead for 
Did you mean: 

Include a Result Column equal to Condition Condition

arijitkumardas
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi there

Is there a way to have a Result Column that is equal to a Condition Condition in an Expression?

For eg:

Expression1

InputA     OutputB

01               Z1              

01               Z2

01               Z3

Expression2

InputA     OutputB

Z1               1001

Z2               1002

Z3               1003

Table

ColumnA     ColumnB

Z1               1001

Z2               1002

Z3               1003

Loop at Expression1; then execute Expression2 (multi level). This gives us OutputB - 1001, 1002, 1003. My Table has only the OutputB. I need to hold the value for InputA too. And I do not want to add another Output column to my Expression2 and repeat the data with InputA. Even though that would work.

Regards

Arijit

Accepted Solutions (0)

Answers (2)

Answers (2)

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Arijit,

This can also be achieved by calling the expressions in a rule. Say, in Rule R1 you call Exp1 first. Exp1 returns object obj1 as result. Then you call Exp2 that checks the value of obj1 and returns obj2.

Both obj1 and obj2 should be available in function's context.

Thanks,

Anindya

arijitkumardas
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Anindya

That is what I am trying to achieve too.

I have 2 Rules.

In Rule 1 I process Exp 2. The Conditions to Exp 2 are - Exp 1 (which returns a single Element) and another Element. My Result is a multi-line Element from this Expression.

In Rule 2 I LOOP at the multi-line Element; and the multi-line Element is a Condition of Exp 3. Here my Results are 2 Elements.

Now the issue is that I am not able to insert any Expression except Expression 1 as a Condition! I am not sure why this is happening? Is there a restriction of some kind? 


I just created another Expression to test the theory again; and I don't see Expression 2 or 3 when I do a Insert Column >> From Expression! All I see is Expression 1!


Why would this happen?


Is it a Unified Rendering issue?




Thanks

Arijit

kakshat
Advisor
Advisor
0 Kudos

Hi Arijit,

This looks like the same or similar problem I remember you had posted separately. But I remember you saying that you were able to resolve that. Anyway...

What you can insert as columns in a decision table (I believe that's what you use in Expression #3) is what is available in the context. So, you need to make sure that whatever you are trying to add is available in the context. You can see what's available in the decision table's context by clicking on the "Context Overview" button.

Akshat

pokrakam
Active Contributor
0 Kudos

Hi Arijit,

Use a nested expression: Expression1 is your outer table and Expression2 is the inner table that provides the result.

Regards,

Mike

arijitkumardas
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mike

Thank you for your response.

Would you be able to provide me with an example of a Nested Expression? A screen shot or URL?

Regards

Arijit

pokrakam
Active Contributor
0 Kudos

Hi Arijit,

A nested expression is just an expression in an expression. So in your result field you can enter another expression.

Small problem however is that this won't work in your scenario. Sorry, I typed too fast for my brain in my earlier answer. An expression can only access what is in the context, so to use a value from the table you would have to bring it back into the context. This can be done in a rule/set, as Anindya already explained.

Just to give an example how it could work:

Expression1:

F1F2Result
1Z1A1
2Z2A2
3*Expression2
**Expression3

Here, Expression2/3 have access to the context (which may contain F3 F4 etc.). But because the lookup value for Expression2 in your case comes from the table itself, BRF+ currently does not provide a mechanism for passing that into Expression2.

Regards,

Mike

arijitkumardas
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mike

Thank you for your reply.

I understand your solution; however I am not sure how to implement it?

Ques. 1 -

How do I bring the Expression into the Context of my current Expression?

Ques. 2 -

Why do I just see the 1 Expression in my Input Condition? Why not Expression 2 / 3? Should not all global elements be accessible to the Input Context?

Thanks

Arijit

pokrakam
Active Contributor
0 Kudos

Hi Arijit,

As I said, it won't work for your case. I showed an example of how it might work in other scenarios, just to clarify what I was talking about.

To implement it, in the result cell you normally see the three dots to click on to enter a value. Instead, click on the little selector icon next to it, and from there you can select expression. Instead of a result value, you can then insert an expression that provides the result.

All elements are populated, but in your scenario the second expression depends on the result from the first, which can't be done in one table row. Nested expressions only work if all the data is available when the rule runs.

Regards,

Mike

arijitkumardas
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mike

Thanks for reverting back. Apologies for the delay in getting back. Your solution sounds perfect. However, I am not able to implement it in the below use case 😞

My Input is a multi-line Element (the result of another Expression). I am not able to insert the Expression in my Condition Column. I can only select an Element.

Since my Output column = Input column in this case; which is a multi-line Element I am not able to select it even when I click the 3 dots in my Result column. The only Expression I can select (Input or Output) is the first Expression in my Ruleset which returns a single Element.

Regards

Arijit