Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default to Current Year

Hi

When sheet is activated, I want to default field "Year" to Current Year Variable.

Field = Year

Variable = _SySCurrentYear

Can someone suggest how to do this?

5 Replies
its_anandrjs

Hi,

I suggest you do this like

Field = Year

Variable = Year(Yearstart( Today( ) ) )

Rgds

Anand

its_anandrjs

Hi,

Or you can directly assign if there is field Year like

Field = Year

Variable = Year

Rgds

Anand

Not applicable
Author

where should i assign this? i want this filter to be applied only for 1 chart on 1 sheet and not for rest of the sheets

its_anandrjs

Hi,

Use this variable only on single sheet or single chart.

Rgds

Anand

johnw
Champion III
Champion III

If you only want this to affect a single chart, you probably don't want to make any selections.  Instead, you'll probably want set analysis.  As an example, say your chart has an expression of sum(Sales).  To restrict this to only the current year based on your variable, you might use an expression like this.

sum({<Year*={'$(_SySCurrentYear)'}>} Sales)

The exact expression may depend on how your field and variable are defined, though.