I want to design a study on Qualtrics. In the study, particapants will be allowed to spend the income they earned in previous stages. There are 8 spending options given to participants. I used branch logic in the stage of deducting the expenditure from the net incomeç. Homewer, it did not work completely. I am open to suggestions on this issue.
Thank you in advance.
Best.
Page 1 / 2
You are setting “Remaining_Amount” to be “Net_Income” minus “last spending option’s cost” or “last spending option’s choice’s cost” if you use “Net_Income” within the math operation.
Not exactly sure about your question set up for 8 spending options. For example,
“Housing” as a spending option and question itself with more choices like “Cheap house”, “Expensive house”, “Rent”, etc.
“Cheap house” and “Expensive house” are all considered as spending options within a question.
Assuming to be example 1, “Housing” is one of the 8 spending options with “Cheap house” and “Expensive house” as choices where survey takers can only select 1 choice.
--
If so, you should set embedded data “Remaining_Amount”= ${e://Field/Net_Income}
Then, create a group “Housing” and place the respective choice branch logic inside.
Then, within condition for 1st choice (cheap house) branch logic:
Create 7 more groups for your remaining 7 spending options…
--
Assuming to be example 2 (“Cheap house” is considered as one spending option while “Expensive house” is considered another spending option), implying that survey takers can buy both “Cheap house” and “Expensive house”.
--
If so, you should set embedded data “Remaining_Amount”= ${e://Field/Net_Income}
Then, within condition for 1st spending option (cheap house) branch logic:
So that it takes the remaining amount to deduct whatever selection cost instead of using net income.
Hope this helps.
I don’t see any use of first embedded variable, any how
The 8 spending options you list, are they multi select or single select. If its multi select, you need to have unique embedded variable for each option.
You are setting “Remaining_Amount” to be “Net_Income” minus “last spending option’s cost” or “last spending option’s choice’s cost” if you use “Net_Income” within the math operation.
Not exactly sure about your question set up for 8 spending options. For example,
“Housing” as a spending option and question itself with more choices like “Cheap house”, “Expensive house”, “Rent”, etc.
“Cheap house” and “Expensive house” are all considered as spending options within a question.
Assuming to be example 1, “Housing” is one of the 8 spending options with “Cheap house” and “Expensive house” as choices where survey takers can only select 1 choice.
--
If so, you should set embedded data “Remaining_Amount”= ${e://Field/Net_Income}
Then, create a group “Housing” and place the respective choice branch logic inside.
Then, within condition for 1st choice (cheap house) branch logic:
Create 7 more groups for your remaining 7 spending options…
--
Assuming to be example 2 (“Cheap house” is considered as one spending option while “Expensive house” is considered another spending option), implying that survey takers can buy both “Cheap house” and “Expensive house”.
--
If so, you should set embedded data “Remaining_Amount”= ${e://Field/Net_Income}
Then, within condition for 1st spending option (cheap house) branch logic:
Net income is calculated by adding and subtracting the income and expenses obtained in previous stages. For this reason, the remaining amount is preferred in this stage. Expenditures will be made from net income and the remaining amount will be obtained by subtracting the expenditure amount.
I don’t see any use of first embedded variable, any how
The 8 spending options you list, are they multi select or single select. If its multi select, you need to have unique embedded variable for each option.
Hello, thank you for answer. Survey taker must choose only one option. Other rounds they can choose more than one but this round they have only one option.
I don’t see any use of first embedded variable, any how
The 8 spending options you list, are they multi select or single select. If its multi select, you need to have unique embedded variable for each option.
Hello, thank you for answer. Survey taker must choose only one option. Other rounds they can choose more than one but this round they have only one option.
Can you show, how the 8 options are listed. even a sample list is enough
I don’t see any use of first embedded variable, any how
The 8 spending options you list, are they multi select or single select. If its multi select, you need to have unique embedded variable for each option.
Hello, thank you for answer. Survey taker must choose only one option. Other rounds they can choose more than one but this round they have only one option.
Can you show, how the 8 options are listed. even a sample list is enough
Here it is;
Could you provide more information on your set up or attach the qsf file?
It is difficult to figure out what is the issue with limited information.
May i also ask what is your qid39 and its selected choices?
I am curious why you need to set this embedded data Remaining_Amount=Net_Income-qid39's selected choices
Could you provide more information on your set up or attach the qsf file?
It is difficult to figure out what is the issue with limited information.
May i also ask what is your qid39 and its selected choices?
I am curious why you need to set this embedded data Remaining_Amount=Net_Income-qid39's selected choices
Survey taker will earn some money from some tasks. After earning money, they have some spending options. Those are;
Could you provide more information on your set up or attach the qsf file?
It is difficult to figure out what is the issue with limited information.
May i also ask what is your qid39 and its selected choices?
I am curious why you need to set this embedded data Remaining_Amount=Net_Income-qid39's selected choices
My qid39 is spending options and selected choices in the same question. I needed to set this embedded data because, net income is calculated by adding and subtracting the income and expenses obtained in previous stages. For this reason, the remaining amount is preferred in this stage. Expenditures will be made from net income and the remaining amount will be obtained by subtracting the expenditure amount. I thought that with this formula I could subtract the amount of the selected option from the net income.
Could you provide more information on your set up or attach the qsf file?
It is difficult to figure out what is the issue with limited information.
May i also ask what is your qid39 and its selected choices?
I am curious why you need to set this embedded data Remaining_Amount=Net_Income-qid39's selected choices
Those are the all the ınformation about it.
Could you provide more information on your set up or attach the qsf file?
It is difficult to figure out what is the issue with limited information.
May i also ask what is your qid39 and its selected choices?
I am curious why you need to set this embedded data Remaining_Amount=Net_Income-qid39's selected choices
// Retrieve the remaining amount from embedded data const remainingAmount = parseFloat("${e://Field/Remaining_Amount}");
// Display the remaining amount in a field const remainingAmountField = qc.querySelector("#remainingAmountField"); if (remainingAmountField) { remainingAmountField.innerHTML = `Remaining Amount: ${remainingAmount} ECU`; } else { // If the field does not exist, create it const newField = document.createElement("div"); newField.id = "remainingAmountField"; newField.innerHTML = `Remaining Amount: ${remainingAmount} ECU`; qc.appendChild(newField); } });
To add the remaining amount to survey, I use this:
<div id="remainingAmountField"></div>
Could it be due to your embedded data format type?
For example, “Buy a Cheap House for 1000 ECU” option, your survey flow’s branch condition is “Buy a Cheap House for ${e://Field/Buy_Cheap_House}”.
I guess this would mean that your piped text “${e://Field/Buy_Cheap_House}” is “1000 ECU” (text) and not “1000” (number).
Try changing your embedded data “Buy_Cheap_House” from “1000 ECU” to “1000” and your branch condition to “Buy a Cheap House for ${e://Field/Buy_Cheap_House} ECU”.
Then, your embedded data “Remaining_Amount” = $e{ e://Field/Net_Income - e://Field/Buy_Cheap_house } should work since all embedded data is now number.
Updated:
My apologies, my page did not refresh and I did not see your new comments earlier when i post the comment.
Please ignore this comment while i continue to try and figure out.
Could it be due to your embedded data format type?
For example, “Buy a Cheap House for 1000 ECU” option, your survey flow’s branch condition is “Buy a Cheap House for ${e://Field/Buy_Cheap_House}”.
I guess this would mean that your piped text “${e://Field/Buy_Cheap_House}” is “1000 ECU” (text) and not “1000” (number).
Try changing your embedded data “Buy_Cheap_House” from “1000 ECU” to “1000” and your branch condition to “Buy a Cheap House for ${e://Field/Buy_Cheap_House} ECU”.
Then, your embedded data “Remaining_Amount” = $e{ e://Field/Net_Income - e://Field/Buy_Cheap_house } should work since all embedded data is now number.
Updated:
My apologies, my page did not refresh and I did not see your new comments earlier when i post the comment.
Please ignore this comment while i continue to try and figure out.
Thank you so much. It finally worked.
Best.
It’s working for single selection but not working for multi selection. Sometimes participants will select more than one option. In that case, what should ı do?
Refer to the blue font section that i mentioned previously.
To briefly explain:
Set an embedded data Remaining_Amount to take the value of Net_Income.
Then use 'Remaining_Amount=Remaining_Amount-spending option'.
Because you want Remaining_Amount to be repeatedly used each time a spending option is selected. Similiar to a recursive function.
Actually I did it. It’s working for single selection.
Please check the middle section of the embedded data that you set.
You set Remaining_Amount=Net_Income-spending option.
I suggested Remaining_Amount=Remaining_Amount-spending option.
Yes you are right it’s my bad. It’s now working for multi selection. Thank you so much.
Hello, I have still some question.If more than one asset is purchased, the amount of the assets in question is successfully deducted from the net income. However, I also want to track the purchased assets under current assets. In this case, only one of the purchased items is visible. How can I fix this?
You can try to use the same logic.
Current_Assets leave it blank.
Then in each branch logic,
Check if Current_Assets is empty, then Current_Assets = purchase asset description.
If Current_Assets is not empty, then Current_Assets = Current_Assets, purchase asset description.
Note:
This will likely combine the purchase items with commas in between.
For example,
A cheap house, An expensive house, A cheap car
Should I set it up like in the ss ?
I meant try to use similar recursive function logic.
Create a embedded Current_Assets and leave it blank.
Then, set conditions that use recursive function for each spending option branch.
For example, under the cheap house branch logic, create 2 more branches. First branch will state cheap house as an asset if there is no existing assets. Second branch will add cheap house to the list of existing assets.
If Current_Assets is empty, Current_Assets= A cheap house.
If Current_Assets is not empty, Current_Assets=Current_Assets,A cheap house.
I meant try to use similar recursive function logic.
Create a embedded Current_Assets and leave it blank.
Then, set conditions that use recursive function for each spending option branch.
For example, under the cheap house branch logic, create 2 more branches. First branch will state cheap house as an asset if there is no existing assets. Second branch will add cheap house to the list of existing assets.
If Current_Assets is empty, Current_Assets= A cheap house.
If Current_Assets is not empty, Current_Assets=Current_Assets,A cheap house.
Sorry for late answer I am very new at qualtrics that’s why I did not know how to that. I think I learned it. I just want to be sure that it’s true or not.
I created branch logic like in the screenshot, but ıt shows twice one of the assets that purchased.
Recheck your embedded data and condition logics.
Could be due to typo. (Current_Assets vs Current_Assests)