Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to set a field equal to another field's selection using set analysis?
Have you tried
{<FieldA = FieldB >}
?
I'm working on the expression that when I select in Field1 it will use the value of that selection in Field2 in the expression. Field 2 table is a subset of Field1 table. I was thinking of this expression but it does not work.
sum({<Field2=Field1>} Count1)
How are your three fields related in your data model? Could you upload a small sample app?
To explain further, here's where I am now.
sum({$<Field2= {"John"}>} Count1)
I want that "John" to be the selected value of Field1.
Try this, should work
sum({<Field2=P(Field1)>} Count1)
What about trying to set the selected value in Field1 into a Variable, and use this variable in set analysis?
The variable would be somethig like this:
vField1 = GetFieldSelections(Field1)
And the set analysis, using this variable:
sum({$<Field2= {$(vField1)}>} Count1)
Regards,
Gabriel
This worked perfectly. Can you explain a bit what the P does. Sorry, I'm a beginner.
From the help window:
There is however an additional way to define a set of field values by the use of a nested set definition.
In such cases, the element functions P() and E() must be used, representing the element set of possible values and the excluded values of a field, respectively. Inside the brackets, it is possible to specify one set expression and one field, e.g. P({1} Customer). These functions cannot be used in other expressions:
Examples:
sum( {$<Customer = P({1<Product={‘Shoe’}>} Customer)>} Sales )
returns the sales for current selection, but only those customers that ever have bought the product ‘Shoe’. The element function P( ) here returns a list of possible customers; those that are implied by the selection ‘Shoe’ in the field Product.
I end up using Clever's solution since I don't have to use variable. Thanks for the help anyway.