Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
shwetagupta
Contributor II

(WeekSales)/ Monthly Sales

Hello All,

Need a help on computing (Week Sales)/ Month Sales of current year, in order to achieve Week's contribution in monthly sale.  I have  already created weeks, month in my calendar.

Any suggestions.

Tags (1)
9 Replies

Re: (WeekSales)/ Monthly Sales

What is your chart dimension or is this in a text box object?

vinieme12
Esteemed Contributor II

Re: (WeekSales)/ Monthly Sales

sum( {< Year = {'$(=Year(Today())'} , Week = {'$(=Week(today())'}  > } Sales)

/

sum( {< Year = {'$(=Year(Today())'} , Month = {'$(=Month(today())'}  > } Sales)

shwetagupta
Contributor II

Re: (WeekSales)/ Monthly Sales

Dimension has sales executive.

shwetagupta
Contributor II

Re: (WeekSales)/ Monthly Sales

Hi

I have created customise weeks where day 1-7 is Week1.

8-15 Week2

15-21 Week3

Beyond 21 all is in week4.

vinieme12
Esteemed Contributor II

Re: (WeekSales)/ Monthly Sales

i believe you have used week calculation as,  ceil(day(DATE)/7)  in your script; use the same calculation as what you have in the script in the set expression

example

sum( {< Year = {'$(=Year(Today())'} , Week = {'$(=ceil(day(today())/7) '}  > } Sales)

/

sum( {< Year = {'$(=Year(Today())'} , Month = {'$(=Month(today())'}  > } Sales)

shwetagupta
Contributor II

Re: (WeekSales)/ Monthly Sales

I am using this with my calendar(In script) for creating weeks.

IF(num(Left(D,2))<=7,'W1',

  IF(num(Left(D,2))>=8 And num(Left(D,2))<=14,'W2',

  IF(num(Left(D,2))>=15 And num(Left(D,2))<=21,'W3',

  IF(num(Left(D,2))>=21 ,'W4'))))  As  'Week'

vinieme12
Esteemed Contributor II

Re: (WeekSales)/ Monthly Sales

what is the format of the field "D"?

shwetagupta
Contributor II

Re: (WeekSales)/ Monthly Sales

D is date having format DD-MM-YYYY

vinieme12
Esteemed Contributor II

Re: (WeekSales)/ Monthly Sales

create a variable as below, and use this in your expression

vWeekIN =  'W' & if(day(Today())>21,4,ceil(day(today())/7))

Expression

sum( {< Year = {'$(=Year(Today())'} , Week = {'$(=vWeekIN')}  > } Sales)

/

sum( {< Year = {'$(=Year(Today())'} , Month = {'$(=Month(today())'}  > } Sales)