Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Inputbox data type

Hi,

I have an inputbox which limits user selection to week,month and ytd. I presumed they would be a text hence added single quotation to each of those however the drop-down displays quotation as well which is undesirable. If I add these values without quotations then they will look fine but lead to another issue. I have another variable which convert user selection to numeric value, e.g. week=0,month=1 and ytd=2 and the if statements seem only work with quotation for text values. Can anyone sheds some lights?

Thanks

Dan

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

I have attached the example here.

View solution in original post

7 Replies
Digvijay_Singh

Not sure of exact need but you can always use num() function to convert text number data to numeric. Its better to use numeric values as long as possible, normally Qlik internally takes care of which type to be used as each value is stored as dual(text and numeric) internally.

jonathandienst
Partner - Champion III
Partner - Champion III

A better solution may be to create a dual field for this purpose. An inline load like this would create the field:


Periods:

LOAD Dual(Period, Value) As Period,

     Value As Period.Value

INLINE

[

     Period, Value

     week, 0

     month, 1

     ytd, 2

];



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

The dual value could act as a numeric or as a text value depending on the context. Rather than a variable use this field in a list box and set the Always One Selected Value property. You can then use this field in your set expressions and filter logic.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
petter
Partner - Champion III
Partner - Champion III

I think it could be implemented in this way:

2015-10-15 #1.png

petter
Partner - Champion III
Partner - Champion III

I have attached the example here.

Not applicable
Author

That does solve the problem. Thanks

petter
Partner - Champion III
Partner - Champion III

You're welcome. Please close the thread by marking it answered