Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

c_buick222
New Contributor

Dynamic Dimension for chart to show last 5 weeks from selected Week

Hi all,

I have been trying to create a dynamic dimension for a chart that will consistently show 5 weeks regardless of selection.

I can get the chart to show me last 5 weeks from the most recent week no problem, weeks 26, 25, 24, 23 and 22. But when I select a specific week, it will only show one week (obiviously)

What I want to be able to do if possible is if week 22 is selected for example, have the chart display weeks 22, 21, 20, 19 and 18, always having 5 weeks available.

Hope this makes sense. Any help would be greatly appreciated.


Thanks.

2 Replies
zhadrakas
Valued Contributor

Re: Dynamic Dimension for chart to show last 5 weeks from selected Week

you can create a variable

maxWeek = max(week)

Your dynamic Dimension:

if(week >= $(maxWeek)-5, week)

That should do the trick.

Think about using a WeekYear field. Then you have no Problem to Show weeks 51,52,1,2,3

regards

tim

arvind_patil
Valued Contributor II

Re: Dynamic Dimension for chart to show last 5 weeks from selected Week

HI ,

You need to create dynamic dimension.

as suggested above by Tim:


if(week >= $(maxWeek)-5, week)


Thanks,

Arvind Patil

Community Browser