Hi @dwaimah
I am glad that we are on the same page as regards the conversion from long to wide format prior to pulling the data as explained in post number 4.
To specifically execute the calculation
I would provide an overall logic that should guide you in the process. I suggest that you try the implementation and then send in the XLS form with dummy data so that we can perfect it.
Logic 1: You can always get what repeat position you are in using the position(…) function
Logic 2: Using the if command within calculation you can actually change the column being pulled.
With the above 2 logics, I have created a formula for putting in the Gender and the Name for up to 20 repeat iterations. This should work for you as long as your repeats are less than 20. Please note, I have a slight workaroundCalculationGenerator_PullingDataFromRepeatGroupsinWideFormat.xlsx (11.5 KB) excel that helps me generate some of these repetitive formulae which I have attached here
The formula for gender will be
if(position(…)=1,(pulldata(‘csvfilename’,‘Gender_1’,‘uniqueID’,${householdID})),(if(position(…)=2,(pulldata(‘csvfilename’,‘Gender_2’,‘uniqueID’,${householdID})),(if(position(…)=3,(pulldata(‘csvfilename’,‘Gender_3’,‘uniqueID’,${householdID})),(if(position(…)=4,(pulldata(‘csvfilename’,‘Gender_4’,‘uniqueID’,${householdID})),(if(position(…)=5,(pulldata(‘csvfilename’,‘Gender_5’,‘uniqueID’,${householdID})),(if(position(…)=6,(pulldata(‘csvfilename’,‘Gender_6’,‘uniqueID’,${householdID})),(if(position(…)=7,(pulldata(‘csvfilename’,‘Gender_7’,‘uniqueID’,${householdID})),(if(position(…)=8,(pulldata(‘csvfilename’,‘Gender_8’,‘uniqueID’,${householdID})),(if(position(…)=9,(pulldata(‘csvfilename’,‘Gender_9’,‘uniqueID’,${householdID})),(if(position(…)=10,(pulldata(‘csvfilename’,‘Gender_10’,‘uniqueID’,${householdID})),(if(position(…)=11,(pulldata(‘csvfilename’,‘Gender_11’,‘uniqueID’,${householdID})),(if(position(…)=12,(pulldata(‘csvfilename’,‘Gender_12’,‘uniqueID’,${householdID})),(if(position(…)=13,(pulldata(‘csvfilename’,‘Gender_13’,‘uniqueID’,${householdID})),(if(position(…)=14,(pulldata(‘csvfilename’,‘Gender_14’,‘uniqueID’,${householdID})),(if(position(…)=15,(pulldata(‘csvfilename’,‘Gender_15’,‘uniqueID’,${householdID})),(if(position(…)=16,(pulldata(‘csvfilename’,‘Gender_16’,‘uniqueID’,${householdID})),(if(position(…)=17,(pulldata(‘csvfilename’,‘Gender_17’,‘uniqueID’,${householdID})),(if(position(…)=18,(pulldata(‘csvfilename’,‘Gender_18’,‘uniqueID’,${householdID})),(if(position(…)=19,(pulldata(‘csvfilename’,‘Gender_19’,‘uniqueID’,${householdID})),(if(position(…)=20,(pulldata(‘csvfilename’,‘Gender_20’,‘uniqueID’,${householdID})),‘’)))))))))))))))))))))))))))))))))))))))
FOR NAME
if(position(…)=1,(pulldata(‘csvfilename’,‘Name_1’,‘uniqueID’,${householdID})),(if(position(…)=2,(pulldata(‘csvfilename’,‘Name_2’,‘uniqueID’,${householdID})),(if(position(…)=3,(pulldata(‘csvfilename’,‘Name_3’,‘uniqueID’,${householdID})),(if(position(…)=4,(pulldata(‘csvfilename’,‘Name_4’,‘uniqueID’,${householdID})),(if(position(…)=5,(pulldata(‘csvfilename’,‘Name_5’,‘uniqueID’,${householdID})),(if(position(…)=6,(pulldata(‘csvfilename’,‘Name_6’,‘uniqueID’,${householdID})),(if(position(…)=7,(pulldata(‘csvfilename’,‘Name_7’,‘uniqueID’,${householdID})),(if(position(…)=8,(pulldata(‘csvfilename’,‘Name_8’,‘uniqueID’,${householdID})),(if(position(…)=9,(pulldata(‘csvfilename’,‘Name_9’,‘uniqueID’,${householdID})),(if(position(…)=10,(pulldata(‘csvfilename’,‘Name_10’,‘uniqueID’,${householdID})),(if(position(…)=11,(pulldata(‘csvfilename’,‘Name_11’,‘uniqueID’,${householdID})),(if(position(…)=12,(pulldata(‘csvfilename’,‘Name_12’,‘uniqueID’,${householdID})),(if(position(…)=13,(pulldata(‘csvfilename’,‘Name_13’,‘uniqueID’,${householdID})),(if(position(…)=14,(pulldata(‘csvfilename’,‘Name_14’,‘uniqueID’,${householdID})),(if(position(…)=15,(pulldata(‘csvfilename’,‘Name_15’,‘uniqueID’,${householdID})),(if(position(…)=16,(pulldata(‘csvfilename’,‘Name_16’,‘uniqueID’,${householdID})),(if(position(…)=17,(pulldata(‘csvfilename’,‘Name_17’,‘uniqueID’,${householdID})),(if(position(…)=18,(pulldata(‘csvfilename’,‘Name_18’,‘uniqueID’,${householdID})),(if(position(…)=19,(pulldata(‘csvfilename’,‘Name_19’,‘uniqueID’,${householdID})),(if(position(…)=20,(pulldata(‘csvfilename’,‘Name_20’,‘uniqueID’,${householdID})),‘’)))))))))))))))))))))))))))))))))))))))
I do hope the above helps you in the process.
Stephane