Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Displaying the default value of a list box dynamically

Hi Every one,

I have a small query. I have a list box with year values in it. For that list box I have to keep a default value for the Year based on the Current Year in the Calendar year field.

Actually I have hard coded it with the steps.

Settings->Document Properties->Triggers->OnOpen

In that I have set the Field Value of Year to F13.

But the question is I have to display the value of Year based on the current year in the Calendar Year Field.
Can you guys , help me in building an expression for displaying the default value dynamically.

The Data looks like the one mentioned below.

Capture_qlikview.PNG

Many Thanks,

Surendra

7 Replies
autopilot
Contributor III

Re: Displaying the default value of a list box dynamically

If I'm understanding correctly, I think you could get away with using Set Analysis in your Expression for the value you want to hold in the list box. Applying a condition on your set analysis should make it dynamic.

Hope that is helpful.

Re: Displaying the default value of a list box dynamically

Hi Surendra,

Not sure if I got your question right. Assuming that what you want is to dynamically select current year in the field [Calendar Year], add a new action on open, select in field, [Calendar Year] and search string

=Year(Today())

Is that what you are looking for?

Miguel

Not applicable

Re: Displaying the default value of a list box dynamically

Hi Miguel,

That was the context of the question. How ever I got a different question now. I need to display the default year such that if the

current date falls under 01-April-(year)  to 31-March-(year+1), the default financial year has to be displayed as (year+1).

Can you help me in developing expression that displays the value of the year accordingly.

Re: Displaying the default value of a list box dynamically

Hi,

Use the InYearToDate() function as in this example:

=InYearToDate('01/04/2012', '31/03/2012', 0, 4)

Where the first parameter is the date, the second the end of the year, the third (0) shows this year, next year (1), previous year (-1), and the fourth (4) in which natural month the year starts (April in this case). The example above will return 0 (false) because is not on this fiscal year, but

=InYearToDate('01/01/2012', '31/03/2012', 0, 4)

will return -1 (true) because it's on this fiscal year

Hope that helps.

Miguel

Not applicable

Re: Displaying the default value of a list box dynamically

Hi Miguel,

That sounds like a good idea.

I don't think we can hard code the date expression. The Year(Financial Year) has to be displayed checking the current date to fall in the range( 01-April-(year)  to 31-March-(year+1)) . Please can you help me in making the expression.

Thanks,

Surendra

Not applicable

Re: Displaying the default value of a list box dynamically

Guys,

Can any one help me regarding this

Re: Displaying the default value of a list box dynamically

Hi,

Why you don't create this as a field in your calendar script with two possible values 1 and 0, for example, so you will select 1 meaning all dates in current fiscal year and 0 otherwise?

Hope that helps.

Miguel

Community Browser