Qualtrics - how to read and set choice values - qualtrics

I'm trying to set choice values using javascript. First, I'm trying to get the question choice values.
For this, I call
var choices = this.getChoices( "radio" )
firstChoice = choices[0]
secondChoice =choices[1]
I get 1,2 for firstChoice and secondChoice, respectively; however, these are not the values/captions of the choices. How can I get the real values/captions?
Then, I'd love to set the new values for these choices. Specifically, I want to add 3 to each one of the values. How can I do that? Manh thanks in advance!

Related

How to get specific value from data frame according other variable in R?

I have an "issue" variable that will change according to user input, for example I choose Unbonded.
And I make "currentdata" variable to get data from database like this.
issue <- "Unbonded"
currentdata <- dbGetQuery(con,paste0("SELECT TOP 1 WITH TIES
Unbonded,
Clogged,
Dirty,
Leaking,
Others
FROM Table_Analytic
ORDER BY Table_Analytic.ID DESC;"))
currentissue <- currentdata$ ????
How can I get only the values ​​that match with the issue to put into the "currentissue" variable
Thankyou
You can use the following code:
currentissue <- currentdata[[issue]]

rpivotTable- hiddenFromAggregators and hiddenFromDragDrop options are not working

I tried to find any example related to this topic but didn't find any clear answer. Issue related to this was asked and closed a year ago. Sorry, I didn't find anything useful on that blog.
Firstly, I'm trying to hide a specific variable from drag and drop panels while constructing a pivot table. Secondly, I want to use a specific variable as an aggregator and remove all rest of the variables from the aggregator list.
Note: I don't want to remove that variable from the data frame. Options for example rows, cols, vals, aggregatorName, rendererName are working perfectly. But hiddenFromDragDrop and hiddenFromAggregators are not working, or I'm using them in wrong way.
My data is too big. An example code to clear my question is given here. This data has 4 variables, Eye, Sex, Hair, and Freq. I want to hide "Freq" from the DragDrop list and "Eye","Hair","Sex" from aggregator attribute list. I'm looking for a working example. I'll appreciate your help. Thank you.
library(rpivotTable)
data(HairEyeColor)
rpivotTable(data = HairEyeColor, rows = "Hair",cols="Eye", vals = "Freq",
aggregatorName = "Sum", rendererName = "Table",
hiddenFromDragDrop="Freq",hiddenFromAggregators=c("Eye","Hair","Sex"), width="100%", height="400px")

Extracting sequence of column names for Shiny

I am constructing an RShiny app and am trying to generate the checkboxGroupInput options in an efficient manner.
I'd like to create a vector with every odd column name to avoid doing the below to generate the potential options for the user to select:
checkboxGroupInput("names","Names",c(colnames(df)[ncol(df)],colnames(df)[ncol(df)-2],colnames(df)[ncol(df)-4],etc...))
Is there a way to extract column names with a function like seq or letters? Ideally it would be something like, though of course the below does not work:
vector=c(colnames(Runs)[ncol(Runs)]:colnames(Runs)[3],-2)
Then I'd want to just insert that vector into the checkbox field.
Thanks for your help!
You can proceed with seq setting a negative by :
colnames(df)[seq(from = ncol(df), to = 1, by = -2)]
(It's not related to shiny though.)

Groupping in Gauge Panel, possible?

i am currently trying to Group Values given to Pointers in a Gauge Panel.
The Scenario Looks like this:
Now i have a dataset with the following Fields:
KPIName
KPIValue
I have all the Values in KPIValue, and I Group them with the field KPIName since i currently have 4 different KPIValues.
What i want to accomplish now is to put in 4 different Pointers in my GaugePanel and let them Show each KPIValue, meaning I want them to be Grouped, or at least let each pointer individually be Filtered to the KPIName it is supposed to Show.
I am working with GaugePanels for the first time, but it doesn't really seem possible to me for now,
Is there a solution ?
Is there a way ?
Or at least a Workaround ? (like adding custom fields to the Data Set, which are filtered by KPIName, or something similiar ?)
Thanks a lot for your Help!
Set the expression for the pointers to
=Sum(IIf(Fields!KPI.Value = "KPI1", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI2", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI3", Fields!Value.Value, 0))
...

Spreadsheetgear .find method

Tools: asp.net VB, SpreadsheetGear 2010
I need to read in Excel files from external users and I do not control the format. There are 3 sections of data. I am able to read in the header. The challenge is that the body details can contain an infinite number of rows, and sometimes those rows are blank. I can determine the footer row because there is a piece of text that is unique. Therefore I can perform the following:
Dim dFoot As SpreadsheetGear.IRange = worksheet.Cells("20:21").Rows
Dim rngDet As SpreadsheetGear.IRange
rngDet = dFoot.Find(what:="UNIQUE TEXT HERE",
lookIn:=SpreadsheetGear.FindLookIn.Values,
lookAt:=SpreadsheetGear.LookAt.Whole,
searchOrder:=SpreadsheetGear.SearchOrder.ByColumns,
searchDirection:=SpreadsheetGear.SearchDirection.Next,
matchCase:=False,
after:=dFoot)
Unfortunately, I am now stuck here. I cannot determine where the cell is (i.e. V79) or how to move 7 columns over and 3 down to get the first value for inserting. I have tried offset and different methods of reading the rngDet, but no luck. I have also tried rngDet.Activate() to read the active cell, but it does not work the same as Microsoft.
I appreciate any help you can provide.
Tim, Thank you for your questions. First time asking so I probably was not very clear. I did find the answer for myself today. I have a group of cells that I need to upload. The problem is that they will be moving up and down the page depending on how many rows were entered in the section above. I realized that I did know what column it was going to be in so I performed the following:
Dim x As Integer
Dim xFooter As Integer
Dim columnnumber As Integer = 21 'Column V
txtTest.Text = worksheet.Cells.RowCount
For x = 500 To 1 Step -1
If worksheet.Cells(x, columnnumber).Value = "TOTAL PRODUCT COST CALCULATION" Then
txtTest.Text = x
xFooter = x
Exit For
End If
Next x
I am now able to use my x value as the left hand corner of my group of cells. I know that the values go over 7 columns from here and down 20 rows which gives me my quandrant of values.
Thought I would share just in case anyone has the same problem.

Resources