15 Replies Latest reply: Dec 3, 2013 3:42 AM by Aasif Ansari

# Display set of weeks on x axis

Hey techies,

I am trying to display a set of last 26 weeks on x axis irrespective of its values, but if i take largest 26 weeks in dimension limits it takes weeks largest based on values, can someone please suggest me how to overcome this issue,

thanks.

• ###### Re: Display set of weeks on x axis

Hello,

Maybe you should try ordering the Week  dimension in the chart, by ascending numeric values (in the "Ordering" tab of the chart).

Hope this helps.

• ###### Re: Display set of weeks on x axis

Thanks for you quick reply, bu i have tried this option too but its not working,

i have written expression as

Sum({\$<Week = {">=\$(=vMinWeek)<=\$(=vMaxWeek)"}>} Qty),''),

where vMaxWeek is max(Week)  and vMinWeek is "max(week) -26"

which is not working.

• ###### Re: Display set of weeks on x axis

can u post some sample data or app???

• ###### Re: Display set of weeks on x axis

Hello,

if the week is a dimension in your data model, maybe the solution is easier.

Set the dimension to Week and set the expression to sum (Qty)

Does this make any sense?

• ###### Re: Display set of weeks on x axis

Hi Aasif,

Assuming that you are using Week as the dimension then maybe you could try

Sum({<Week = {">=\$(=max(Week)-25)<=\$(=max(Week))"}>} Qty)

Hope this helps.

Cheers,

Tyler

• ###### Re: Display set of weeks on x axis

Hi Aasif,

Try like this

Use your week as dimension and use the following as expression, if you have any date dimension in your data model

=Sum({<MonthDimensionName=, WeekDimensionName=, YearDimensionName=, QuarterDimensionName=, DateDimensionName = {'>=\$(=WeekStart(Max(DateDimensionName), -25))<=\$(=WeekEnd(Max(DateDimensionName)))'}>} MeasureName)

Here we are controlling the dimensional values with the expression, always you will get the last 26 weeks.

Regards,

Jagan.

• ###### Re: Display set of weeks on x axis

Hi,

attached here is sample file,

I need to display last 26 weeks starting from week(201313) to (201348).

week must be in sorted ascending numeric and all 26 weeks should me displayed

thanks and regards.

• ###### Re: Display set of weeks on x axis

Is this what you are looking for? Note that the scrollbar appears:

• ###### Re: Re: Display set of weeks on x axis

Hi Aasif,

Please find attached, there aren't 26 values in the chart since it looks like you don't have values for some of the weeks, if you want to get the last 26 weekly values then you would probably be best served doing that in your script.

Cheers,

Tyler

• ###### Re: Display set of weeks on x axis

It seems looking fine let me check and apply this on my qvw file.

thanks

• ###### Re: Display set of weeks on x axis

Thanks,

it seems looking correct answer for me,

let me check it on my file,

• ###### Re: Re: Display set of weeks on x axis

PFA.

• ###### Re: Display set of weeks on x axis

Hi There,

thanks for your help in resolving the issue but now there is some complications arise,

Its working fine with the weeks of same year but as year changes its not working.

please find attachment.

kindly suggest any logic or code to resolve this issue.

Thanks

• ###### Re: Display set of weeks on x axis

Hi,

You need to arrive a date field in script and should use the set analysis expression

Data:

LOAD

WeekNumber,

Quantity,

MakeWeekDate(Left(, 4), Num(Right(WeekNumber, 2))) AS Date

FROM DataSource;

Use weeknumber as dimension and use this expression

=Sum({<WeekNumber=, Date= {'>=\$(=WeekStart(Max(Date), -25))<=\$(=WeekEnd(Max(Date)))'}>} MeasureName)

Hope this helps you.

Regards,

Jagan.

• ###### Re: Display set of weeks on x axis

Hi All,

Thanks for all your support,

This issue has been resolved using 'Autonumber()' to weeks based on which we can sort and take desired no of weeks.

Thanks a lot