Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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
MVP
MVP

Re: Inputbox data type

I have attached the example here.

7 Replies
Digvijay_Singh
Honored Contributor III

Re: Inputbox data type

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.

MVP
MVP

Re: Inputbox data type

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
MVP
MVP

Re: Inputbox data type

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
MVP
MVP

Re: Inputbox data type

I think it could be implemented in this way:

2015-10-15 #1.png

MVP
MVP

Re: Inputbox data type

I have attached the example here.

Not applicable

Re: Inputbox data type

That does solve the problem. Thanks

MVP
MVP

Re: Inputbox data type

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

Community Browser