Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

ronaldwang
Contributor III

condition on the field value in a listbox or slider

 

I have created a slider and give use to choose a value from a filed (say Date). how can I limit the user only have the option to choose the most recent 1 month’s date? thanks

 

1 Solution

Accepted Solutions

Re: condition on the field value in a listbox or slider

You can use this if you don't have forecast dates in your field, This works either List and Slider objects

=If(Date >= Date(Max(TOTAL Date-30)) and Date <= Max(TOTAL Date), Date)

If, Forecast data is fetching then this?

=If(Date >= Date(Max(TOTAL Today()-30)) and Date <= Max(TOTAL Today()), Date)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

7 Replies
luismadriz
Valued Contributor

Re: condition on the field value in a listbox or slider

Hi,

Please use something like this as the dimension:

=AGGR(Only({<TransactionDate={">=$(=Date(Max(TransactionDate)-30))"}>} TransactionDate), TransactionDate)

I hope it helps,

Cheers,

Luis

Re: condition on the field value in a listbox or slider

You can use this if you don't have forecast dates in your field, This works either List and Slider objects

=If(Date >= Date(Max(TOTAL Date-30)) and Date <= Max(TOTAL Date), Date)

If, Forecast data is fetching then this?

=If(Date >= Date(Max(TOTAL Today()-30)) and Date <= Max(TOTAL Today()), Date)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

ronaldwang
Contributor III

Re: condition on the field value in a listbox or slider

Hi Anil,

There is one issue with this expression, that is once you chose a date, the date available for next selection will be the chosen date to chosen date-30 only.

Re: condition on the field value in a listbox or slider

Not sure, What you meant by Next selection? Perhaps remove = sign in second operator.

=If(Date >= Date(Max(TOTAL Date-30)) and Date < Max(TOTAL Date), Date)


Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
ronaldwang
Contributor III

Re: condition on the field value in a listbox or slider

say, if I chose 1/9/2017 as current selection.

once the dashboard refreshed, if I want to change the date, the data available for selection change to 1/8/2017 to 1/9/2017 instead of 30/10/2017 to 30/11/2017. as Total Date changed to 1/9/2017

Re: condition on the field value in a listbox or slider

If, We have something triggers assigned in your alternate triggers for some actions. You could constant them even filter selection won't effect to this?

Either one of these?

=AGGR(Only({<Date={">=$(=Date(Max(Date)-30)) <=$(=Max({1} Date))"}>} Date), Date)

OR

=If(Date >= Date(Max(TOTAL Today()-30)) and Date <= Max({1} TOTAL Today()), Date)

OR
=If(Date >= Date(Max(TOTAL Date-30)) and Date <= Max({1} TOTAL Date), Date)

- SAB

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
luismadriz
Valued Contributor

Re: condition on the field value in a listbox or slider

Hi,

I can't follow your explanation, but you may want to try this:

=AGGR(Only({<Date={">=$(=Date(Max({1} Date)-30))"}>} Date), Date)