Closed alextanski closed 5 years ago
@alextanski https://github.com/Crunch-io/scrunch/pull/374
Thanks @mathiasbc !
thanks @mathiasbc, looks good. We can, however, leave out the code for getting the id
from the subvariable definition, as (of course) Crunch generates that one directly from the url created for the subreference, hence no point to pass/get()
it.
Thanks for the quick fix! 👍
The pull request has been merged after the latest fix from Mathias. Closing.
Currently, when creating a variable that is built from subvariables (i.e. categorical arrays and multiple responses), the payload only requires that their
name
attribute to be provided:This results in the server enumerating the subvariables, appending
-number
to the parent variable name, e.g.:We are already passing id and alias for each of the items into the method, so it can be corrected by simply also getting those properties from the input if provided:
The current behavior is problematic because of two things:
It is not consistent with the way the "reversed" way of the conversion from Crunch to QP is working, for example in Crex and general SSC DP.
It is leading to metadata conflicts in tracker scenarios, because the way DP has set up the dataset pre-Crunch is not reflected when a variable is created based on the definition they are seeing in their QP file.
The problem cannot be worked around (especially for MR variables), as we are treating multiple responses questions as "normal" questions, not as an array, so DP is not able to control the subvariable names manually by renaming. They are part of the metadata conversion.
tagging @jamesrkg.