Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i using line chart WTD calculation.my dimension is week
if i select the month September i want to show the week sales up to 39 only and i want to show only 39 week only in line chart.
Thanks in advance
Dear sunindia
Thank you for your response
finally i got the correct answer
sum({$<Year = {$(=max(Year))},TransactionType={'INVOICE'},Week={"<=$(=Max(Week))"},Quarter=,Month= >} #InvNetSales) -
sum({$<Year = {$(=max(Year))},TransactionType={'CreditNote'},Week={"<=$(=Max(Week))"} ,Quarter=,Month=>} #InvNetSales)
May be this:
{<DateField = {"$(='>=' & Date(YearStart(Max(DateField)), 'YourDateFieldFormat') & '<=' & Date(WeekEnd(Max(DateField)), 'YourDateFieldFormat'))"}>}
or:
{<WeekNum = {"$(= '<=' & Max({<Year = {'=$(=Max(Year))'}>}WeekNum))"}, Year = {<'=$(=Max(Year))'>}>}
i want to compare the current year week Vs last year week
Let me test it out and get back to you in a bit ![]()
Sample Script:
TABLE:
LOAD *,
Rand() * 100000 as Data,
Week(Date) as Week;
LOAD Date(AddYears(YearStart(Today()), -4) + RecNo() - 1) as Date
AutoGenerate Today() - AddYears(YearStart(Today()), -4) + 1;
Line Chart and Straight Table:
Dimension: Week
Expression1: =Sum({<Date = {"$(='>=' & Date(YearStart(Max(Date))) & '<=' & Date(WeekEnd(Max(Date))))"}>} Data)
Expression2: =Sum({<Date = {"$(='>=' & Date(AddYears(YearStart(Max(Date)), -1)) & '<=' & Date(AddYears(WeekEnd(Max(Date)), -1)))"}>} Data)
Line Chart:
Straight Table:
See if this is somewhat helpful.
Best,
Sunny
I tried this below formula.i get only the selected month weeks but i want before months weeks also.
sum({$<Year = {$(=max(Year))},TransactionType={'INVOICE'},Week={"<=$(=Max(Week))"},Quarter=,Week= >} #InvNetSales) -
sum({$<Year = {$(=max(Year))},TransactionType={'CreditNote'},Week={"<=$(=Max(Week))"} ,Quarter=,Week=>} #InvNetSales)

Dear sunindia
Thank you for your response
finally i got the correct answer
sum({$<Year = {$(=max(Year))},TransactionType={'INVOICE'},Week={"<=$(=Max(Week))"},Quarter=,Month= >} #InvNetSales) -
sum({$<Year = {$(=max(Year))},TransactionType={'CreditNote'},Week={"<=$(=Max(Week))"} ,Quarter=,Month=>} #InvNetSales)