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

scroll bar limit

Hi,

I've got a scroll bar with date values ('MM-YYYY'). The data is showing the all values in that field. I'd like to limit the shown months. So let's say I'd like to have all values of the 12 months (=last 12 values).

Can anybody help me? With bar Charts it's easy to get the last 12 values, but what about scroll bars?

Cheers,

Tobi

1 Solution

Accepted Solutions
rubenmarin

Hi Tobias, you're right that doesn't works when you select a date, I didn't tested, try with a simpler:

=If(OrderDate>AddMonths(Max(TOTAL {1} OrderDate), -12), OrderDate)

View solution in original post

8 Replies
buzzy996
Master II
Master II

try this way,by using expression u can get last 12 values and we can also control if u need some thing from scroll bar..see below.

sc.PNG

Not applicable
Author

Thanks, but that's not what I'm looking for.

With scroll bar I mean something like that:

Scroll_Bar.JPG

buzzy996
Master II
Master II

ok,can u try with the same expression as u said above u can diaply last 12 values in bar chart,use the same expression in slider object--general tab-Data-Field-select expression "place the same expression here."

rubenmarin

Hi Tobias, that's a slider, in it's properties, in the field list, the last option is <expression>, select that option and use an expression that filters the values you want to show, ie:

=Aggr(If(DateField>AddMonths(Max(TOTAL {1} DateField), -12), DateField), DateField)

Not applicable
Author

Thanks Ruben,

jep that's been what I'm looking for

But the expression is not the right one.. Any other suggestions?


buzzy996
Master II
Master II

can u share ur .qvw?

rubenmarin

Hi Tobias, you're right that doesn't works when you select a date, I didn't tested, try with a simpler:

=If(OrderDate>AddMonths(Max(TOTAL {1} OrderDate), -12), OrderDate)

Not applicable
Author

Great, thanks Ruben.. Exactly what I looked for!