Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

tulasiram_bitra
New Contributor II

week as dimension and show only last 12 weeks

Hi Frnz,

I need to show last 12 Weeks sales. Here Week as Dimension, already i have week Filed.

Please help me to write expression in Week Dimension.

1 Solution

Accepted Solutions
nagarjuna_kotha
Valued Contributor II

Re: week as dimension and show only last 12 weeks

Like this    ?

7 Replies
nagarjuna_kotha
Valued Contributor II

Re: week as dimension and show only last 12 weeks

Hi Can you share sample data ?\

-Nagarjuna

Re: week as dimension and show only last 12 weeks

You could use a condition within the dimension or the expression like:

sum({ YearWeek = {">=$(=max(YearWeek)-12)"}>} Sales)

that requires an appropriate field within a master-calendar. Possible is also to use a flag for these period. Many helpful links could you find here: How to use - Master-Calendar and Date-Values

- Marcus

Not applicable

Re: week as dimension and show only last 12 weeks

you can use a set analysis in your expression.

SUM({<DATE_FIELD={"$(='>=' & Date(Today()-84))"}>} SALES_FIELD)

Re: week as dimension and show only last 12 weeks

if your week field as number, may be try this..

=sum({<Week={'>=$(=max(Week,12))'}>}sales)

Not applicable

Re: week as dimension and show only last 12 weeks

Couple of ways you can add only 12 weeks of data.

1. Add new field in the Master Calendar WeekNumber having 1, 2,3 4, 5, 6 .... for ascending week Number.

Simply add calculated dimension: IF( WeekNumber >= Max(WeekNumber)-12 , WeekNumber )

or

add to set analysis

     Sum({<WeekNumber={">=$(=Max(WeekNumber)-12<=$(=Max(WeekNumber)"}>} Sales)

2. you already have data field in your app.

IF( DateField >= max(date) - (12*7) , WeekName )

nagarjuna_kotha
Valued Contributor II

Re: week as dimension and show only last 12 weeks

Like this    ?

tulasiram_bitra
New Contributor II

Re: week as dimension and show only last 12 weeks

Hi Frnz,

Thanks to all. Almost all expressions are useful.

Community Browser