on 08-17-2015 12:29 PM
Hi ,
Please tell me how can i remove the last entry in the ResultList variable result,
i have a scenario where i need to remove the last value in the result variable ONLY after the udf has completed execution is there any method like result.delete() etc or maybe result.delete(i)
Please Help
Regards
Vinay
Hi,
Use CollapseContext after UDF,it will give only the first values in the context.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinay,
ResultList only have these 3 add and 1 clear function, nothing similar like result.delete(i) or result.remove(i) that you asked. So, previous solution by others above should be compact enough and nothing more compact could be achieved.
addContextChange()
addSuppress()
addValue(Object value)
clear()
Reference:
Regards,
Yee Loon
Hi Vinay,
AFAIK, there is no method for the ResultList class to achieve this.
I think you need to handle this in the udf where the result variable is getting populated by either putting a clause when it is the last value execution etc.
Let us know providing proper screenshots if you are having any issues.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you can handle the same with some logic within your current UDF i.e., don't add the last value to ResultList object
Else if you have an obvious reason you can't omit last value for some XXX reason in current UDF, create one another UDF to iterate over your current UDF output and ignore last record when you are generating new resultlist
Br,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.