Again, please use opendatakit@ not opendatakit-developers@ for these
questions.
Note that the internal form and the external form are using different
values for the selection choice strings and their values. If you change the
internal form to use the same values as the external form, you would find
that the two perform identically -- they both work as the external form
currently does. This is a good learning experience -- if you notice
different behaviors across two different versions of a form, try to
eliminate as many differences between the two forms as you can. This will
often lead you to identifying exactly what is causing this behavior.
In this case, the form, and >=, work correctly.
The value for a selection choice is a string.
When you compare strings, they are compared in alphabetical (lexical)
order.
i.e.,
"9" > "13"
because the first letter ('9') of the string "9" is alphabetically greater
than the first letter ('1') of the string "13"
So if you select "9" in the first question, the only answer displayed is
"9" in the 2nd.
If you select "21" in the first question, the choices: "9", "21", "49" and
"73" are displayed because the values of each of these selection choices
are all alphabetically >= "21".
To get "9" to be less than "13" you could add a leading zero, and force
Excel to treat the value as a string by preceding it with an apostrophe.
That can be tricky to get right, so I often suggest people begin select
choice values with letters (e.g., "n09", "n13", "n21", etc.)
When the values are compared internally, you can wrap the references with
the int() function to compare them as integer values. Unfortunately, for
performance reasons, this does not work when these values are stored in an
external dataset -- the comparisons can only be done as strings.
···
On Mon, Feb 2, 2015 at 12:33 PM, Angelo Lazzari wrote:
Hi Mitch, thank you for your answer. I did what you wrote, here are the
form i attached in a previuous mail, the external do not work and the
normal select_one works... the response are displayed in two different
screen... but, due to your last sentence i think the <= or >= won't ever
work.... no?
Can you take a rapid look the the examples? Why the normal select_one
works?
Thanks
Il giorno Mon Feb 02 2015 at 19:34:32 Mitch Sundt mitchellsundt@gmail.com ha scritto:
This is a question for the opendatakit@ list, as it concerns the use of
the tools as-is for writing and collecting surveys.
When asking questions, be sure to provide an XLS or XML file
demonstrating your problem.
Requiring respondents to construct their own copy of a form that may or
may not replicate the problem you are experiencing will ensure that nobody
helps you.
In this case, it is likely that you have tried to display both Question_1
and Question_2 on the same screen (using a field-list group). This will not
work.
When displaying multiple questions on the same page/screen, there cannot
be any dependency between the values or relevance of any of the questions.
Try displaying the questions on different pages. This will likely resolve
your issue.
Also, keep in mind that the choice-list values are always treated as
strings. They are not numbers, even if they are just 1, 2, 3 etc.
On Sat, Jan 31, 2015 at 9:40 AM, Angelo Lazzari <lazzari.angelo@gmail.com wrote:
Hi guys,
nobody can help me? Is there an issue or is a normal behavior using a
wrong type variable in a >= condition?
Thank you very much for your time!
Angelo
Il giorno Fri Jan 30 2015 at 17:45:32 Angelo Lazzari < lazzari.angelo@gmail.com> ha scritto:
Hi,
i have a response structure like this:
Question_1 (data comes from an select_one_external )
Question 2 (data comes from the same select_one_external of the
question_1) BUT with a choice_filter like question_2_responses >=
Question_1_response
So if i select 66 in the question_1 i would see in the question_2
response list:
The problem is that since i'm using the external (with the normal
select_one and the current() worked well) the response list of the
question_2 isn't correct... it seems that the ODK is considering the
Question_1_response as a string and that it is trying to order by
string....
Is that possible? How can i achieve my aims? Any ideas?
Thanks
Angelo
--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com
--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com