Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Vinod
New Contributor II

How to display data based on current selection

Hi All,

How to display last 1 year data Based on current selection month.
Example - if I select February month of 2019 year, It should display March  2018 to Feb 2019 data.

Thanks,
Vinod

1 Solution

Accepted Solutions
Partner
Partner

Re: How to display data based on current selection

You can accomplish this by implementing set analysis into your expression.
See my example below. Please observ that you should clear all selectable calendar fields. I cleared Year, YearMonth and Month, but you should adjust these to your field names.

=SUM({<
YearMonth,
Month,
Year,
DateField = {">=$(=monthstart(max(DateField),-11)) <=$(=max(DateField))"}
>} YourValueField)
#OnVacation #BetweenJobs.
Please ekskuse my Norglish and Swenglish typos.
2 Replies
MVP
MVP

Re: How to display data based on current selection

You can use set analysis to get it. Try to share your sample app to get more specified expression.
Partner
Partner

Re: How to display data based on current selection

You can accomplish this by implementing set analysis into your expression.
See my example below. Please observ that you should clear all selectable calendar fields. I cleared Year, YearMonth and Month, but you should adjust these to your field names.

=SUM({<
YearMonth,
Month,
Year,
DateField = {">=$(=monthstart(max(DateField),-11)) <=$(=max(DateField))"}
>} YourValueField)
#OnVacation #BetweenJobs.
Please ekskuse my Norglish and Swenglish typos.