Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rodri_morales
Creator II
Creator II

Default value on slider

Hi everyone, well my problem is that I have a slider with this expresion: =year(BillDate)  and I want that the slider start with a default value selected like "2013", it is posible?

I was looking for an option like "Default Value" (I saw them in sumple tables), but the slider doesnt have it.

8 Replies
israrkhan
Specialist II
Specialist II

hi,

try Year(Max(BillDate)), it will take max year ,if 2013 is max year in your DB,

if you have 2014 you can use Year(Max(BillDate)-1) and so...

rodri_morales
Creator II
Creator II
Author

But I dont want to use only the max year, I want to show all year from bill, but start default value in 2013, do you understand?

israrkhan
Specialist II
Specialist II

Hi Rodrigo,

try below:

=if(GetSelectedCount(BillDate)=0, Year(Max(BillDate)))

Mean if nothing is selected in BillDate than it will take max year, which is 2013, else your selection.

will it help...?

and are you selecting one value at a time in slider? or a rang of value?

rodri_morales
Creator II
Creator II
Author

It doesnt work. I'm selecting one value or a range. There is a picture of the properties of the slider:

deslizador.png

DavidFoster1
Specialist
Specialist

I would need to double check this but if you use a variable and preset that variable with a value (i.e. 2013) then the slider should start at that value. You can then utilise that variable in your expressions.

rodri_morales
Creator II
Creator II
Author

I use the variable BillDate from a data base, how can I preset the value?

DavidFoster1
Specialist
Specialist

I think BillDate is a field not a variable.

Have a look at the test below.

rodri_morales
Creator II
Creator II
Author

I'm working on the free edition of qlikview, I cant see your project. BillDate is a attribute from a database.