Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Slider Values based on month selected

Hi...

I have a listbox for month and a slider displaying the order dates. When I select a particular month, the slider still continues to display all the dates for the year whereas it should only display the order dates for the particular month only. I dont know how to fix the min and max on the slider as I have to select the order date field for the slider.

Thank you.

Regards

Kumar

6 Replies
Not applicable
Author

Hi

I have one option, not sure if this is the best:

when creating the slider, choose an expression instead of the field order date.

then insert

=if( GetSelectedCount(Month) =1, if(Month = GetFieldSelections(Month) , [Order Date]), [Order Date])



It will check if there is only 1 month selected. In case it is, it will only display the order dates from that month.

The downsize is that when you have only one date for the month, it is not showing in the slider.

Cheers


Adriano



Not applicable
Author

Hey Adriano,

I tried the option but I dont know what I am doing wrong here. There is no change in the slider it still continues to display all the dates.

I am attaching the document for your reference.

Thanks for the help.

Regards

Kumar

Miguel_Angel_Baeyens

Hello Kumar,

Having your month field is linked to a date field, once the month is selected, you can set the minimum value as

=Min(DateField)


And likewise for the maximum date. You can even set a condition so the slider will only be displayed when the user has selected a month previously.

Hope that helps

Not applicable
Author

Dear Miguel,

I tried your inputs and it worked with the display of dates for the selected month. I can only display it when i select a variable field 'vDate' and use the min value and max value boxes below.

The expression i used for the min value and max value were:

min value: makedate([Year],Match([Month], $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))

max value:monthend(makedate([Year],Match([Month], $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39)))))

But, then the dates do not impact the other fields. When i select the Order_Date in the field box, the min value and max value boxes are hidden.

I also tried the expression

=if((Order_Date>=makedate([Year],Match([Month], $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39))))) and (Order_Date<=monthend(makedate([Year],Match([Month], $(=chr(39) & Replace(MonthNames, ';', chr(39) & ',' & chr(39)) & chr(39)))))),Order_Date)

But, this expression returned a blank.

So, for now I have selected the Order_Date as the field and displaying all the order dates on the slider independent of the month selected.

Can you help me with what I can change to get this working?

Regards

Kumar

Not applicable
Author

still stuck on it....

Not applicable
Author

Hi Kumar,

did you found a solution for that?

Regards, Martin