This post is more than 5 years old
25 Posts
0
1070
August 11th, 2011 13:00
Set Value with multiple conditions
Hi:
I'm working on a report where I added a new field that will be populated depending on the value of another field.
Basically I have "Field A" with possible values of: a, b, c and d, and "Field B" that should be populated as explained on the table below:
Field A Field B Set Value
a Set Field: Field B - Condition: Field A = a - Set Value = One
b Set Field: Field B - Condition: Field A = b - Set Value = Two
c Set Field: Field B - Condition: Field A = c - Set Value = Three
...
I tried using several Set Value operators as above, but just worked for the first one.
I wonder if is there a way to achieve this task.
Thanks in advance
Enrique



DavidRussell1
141 Posts
0
August 12th, 2011 00:00
Hi Enrique,
From the description you have I believe the method you are using should work.
To test this I created a csv file with 2 columns:
a,
b,
c,
d,
I then fed this into a DPA report using the ReadCSV data source and confirmed that I had a report output that looked like:
Letter Number
a
b
c
d
I then attached that to a SetValue operator and added a condition where Letter was equal to a, set the Number field equal to 1. I then attached another Setvalue operator and added a condition where Letter was equal to b, set the Number field equal to 2. These were both displayed correctly in the report output.
The only reason I can think of why this wouldn't work in your example would be if your 4 rows containing a,b,c and d weren't actually unique rows, but were actually contained within a single element in the xml data. If this was the case then you would see a "Noted" column in your report. If you do see this then it means that your 4 rows aren't unique and have the same values for the key fields. When data isn't unique, although the output in the report looks like separate rows, the multiple values for the same key values are actually stored as a list within the same element in the xml.
If the above isn't the case please can you export your report definition from the report editor, change the file extension to a .html file (as .xml isn't allowed to be attached) and add a reply to this discussion and attach the report definition? I can then take a look and see if I can work out why it isn't working.
Thanks
David
David Russell
EMC Technical Support
Enr2010
25 Posts
0
August 12th, 2011 06:00
Hi David:
Yes, I have the Noted field on my reporty. Of course I very over simplified the example I gave, I'm actually working on a very complex report using different Sources and Operators. It is true there are some issues with unique values. I will keep working on this.
Thanks for your support.