Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I have attached the example here.
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.
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
];
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.
I think it could be implemented in this way:
I have attached the example here.
That does solve the problem. Thanks
You're welcome. Please close the thread by marking it answered