on 04-29-2013 8:45 PM
Hello experts,
I have a UDV for a UDF that uses a simple query to provide a list of options for the field. In addition to that I would like to automatically select a particular option based on the value of another UDF (if any).
My simple query is this:
SELECT distinct SuperCategory from Categories order by supercategory
This provides a list of Categories for the user to choose from, ie.
1.Health Care
2.Education
3.Retail
4.Government
etc.
This works fine to provide a list of options for the U_SuperCategory field. Now I want '2.Education' to be automatically selected when another UDF (U_I_College) is filled in but still have the list available in U_SuperCategory if U_I_College is not filled in.
It's like I require two UDV's for the same field which you can't have, but I was hoping for a clever query that would do both. I've tried things like the following:
select case when $[ORDR.u_i_college] is not null then '2.Education' else (select distinct SuperCategory from Categories order by supercategory) END
It's hard to test UDV queries outside of a form but a modified version of this in the Query Generator generated something like "Query returns more than one value".
Any suggestions?
Hi,
If you got the answer, please close the thread by marking helpful/correct answer.
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for all the answers, but I already knew my query doesn't work and why. My question was, is there a way to do what I want? That is, provide a list for the user to select from in a UDF, but sometimes automatically set it to one of the list values based on another UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Case can only be used for single value result. Therefore, your goal may not be achievable through this grammar. From logic point of view, this is not a normal selection unless you can designate all different values with unique identifier for each of them.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff Putnam
select case when $[ORDR.u_i_college] is not null then '2.Education'
else (select distinct SuperCategory from Categories order by supercategory) END
The Subquery retrieves more than one value so better dont try with the Auto refresh in Fms..
Hope helpful
Regards
Kennedy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
message meaning, the output for the above FMS containe two values.
Please check with FMS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.