Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
ZuhaibRana
Partner - Contributor III
Partner - Contributor III

Selected year to pervious year values

I have created a master calendar that has a year field so I want it when I select any year from the year in the filter pane then it should show the selected year to the previous year's values in the table.

Example:

I have a year's field. In the filter pane that has years from 1995 to 2023.

when I select 2001 from the filter pane then it should show values in the table from 1995 to 2001

 

Qlik Sense Business QlikView 

1 Solution

Accepted Solutions
md_talib
Contributor III
Contributor III

You need to make two variable for the Previous Year. 

so the PY Column will work on your current Year Selection.

vPYCalMinDate 

=date(YearStart(Min(Posting_Date),0,4),'DD/MM/YYYY')

vPYCalMaxDate

=date(AddYears(Max(Posting_Date) ,-1),'DD/MM/YYYY')

the variable is according to fiscal year. you can chnage it as per your requirements.

View solution in original post

1 Reply
md_talib
Contributor III
Contributor III

You need to make two variable for the Previous Year. 

so the PY Column will work on your current Year Selection.

vPYCalMinDate 

=date(YearStart(Min(Posting_Date),0,4),'DD/MM/YYYY')

vPYCalMaxDate

=date(AddYears(Max(Posting_Date) ,-1),'DD/MM/YYYY')

the variable is according to fiscal year. you can chnage it as per your requirements.