13 Replies Latest reply: Jan 26, 2018 6:15 AM by Ali Ahmad

# Create a line chart with total sales this week compared to last week

Hey guys,

I have this table below:

And what  I am trying to do is I want it to show the total amount for  the entire table on the row of jan 2018 and then as the total amount grows I want the next total amount on 2018 februar etc. as it goes.

The key here is that I want to know what is the total of amount today. And then I want to see what is the total amount at that day and be able to see the development on a line chart.

Is this something that I can solve / calculate front-end or would it best to make an aggregated table in the script and have that on the side?

Any suggestions is welcomed!

• ###### Re: Create a line chart with total sales this week compared to last week

Try sthing like this:

if(Capitalize(Month)='Jan',sum(total {<Month>} Amount), sum(total {<Month>} Amount) + RangeSum(above(sum( {<Month>} Amount),0,RowNo()-1)))

and tell me what happens

Per analogy the result would be :

• ###### Re: Create a line chart with total sales this week compared to last week

Don't mind the numbers. I am changing them as we go, but you can see the logic. Is this really possible to be honest? Because I have a total which is X in January, and in February they might have sold more so the total amount would be X more than the previous X amount and I don't have that value stored anywhere.

• ###### Re: Create a line chart with total sales this week compared to last week

Can u please do a simple thing like this to explain what u aim to do :

DimMeasureNew Measure
1100
2200
3300
5400
6500

What I did :

DimMeasureNew Measure(what I did)
11001500 (total of all rows
22001700(1500+200)
33002000(1700+300)
54002400(2000+400)
65002900(2400+500)
• ###### Re: Create a line chart with total sales this week compared to last week

Let me try.

Look at following picture:

So you can see there are two different campaigns. These campaigns have a total value, but are distributed throughout the year. So On the first of January the total sales is  795 because there was only campaign  1 active. Then campaign 2 became active and that also distributes an amount throughout the year, but now the total sales that we have on that day is the total amount on that date.

Gives an idea of sales rate.

• ###### Re: Create a line chart with total sales this week compared to last week

I'm sorry... still not clear to me..

Well, hope I have helped you a little though

• ###### Re: Create a line chart with total sales this week compared to last week

Thank you none the less.

Basically it is Sales Rate Week by Week I am trying to visualise.

Lets see what other replies I get.

• ###### Re: Create a line chart with total sales this week compared to last week

Ok.

Let me try another explanation.

Lets say you write down how much did your company have in total sales today.

Then you next week write down how did the company have in total sales that day.

And then you put that in a line graph.

Makes sense ?

• ###### Re: Create a line chart with total sales this week compared to last week

today is 26 January 2018; when u say, today I want to know how many total sales I have, starting from when?

From 2018? from 2017? from 2001? from the first date in ur model?

• ###### Re: Create a line chart with total sales this week compared to last week

Current year.

So Today 26.01.2018 I want to know how much do we have sold for for in total current year.

Next week I want to know February 2nd I want to know how much have we sold for the current year in total on that date.

Then I am going to make a similar expression for previous year and the interval will be set week for week.

• ###### Re: Create a line chart with total sales this week compared to last week

the in january, the total year is basically : what u have sold in January?

and hen in February, u want to know how much did u sold in January AND february, and so on?

a cumulative vision of ur sales

• ###### Re: Create a line chart with total sales this week compared to last week

No, because the amount is distributed throughout a year.

Imagine you sell a contract and the TOTAL CONTRACT WORTH is 200k.

We will get

100k in January

50k in February

When you look at how much did you sell  for in January the total worth is 200k, but what we will be paid in January is 100k. So you have sold for 150k in January, but will be paid 100k in January and 50k in February.

hope I am explaining this in a ok way. Thanks for replying.

• ###### Re: Create a line chart with total sales this week compared to last week

so in this case, in ur new measure:

what's the number u want to have in January?(100? 150?200?) and in February?(50?150?200?250?)

• ###### Re: Create a line chart with total sales this week compared to last week

Well that really depends on the last 50k. Lets say that 50k is paid to us next year in January then for current year it would be 150k both in January and in February.

But

if another contract comes in January

that pays:

100k in January

50k March

and

100k  January next year.

Then the total in January is 150k + 150k (from the new contract).

Next year the total in January would be.

50k + 100k because that is sold on previous contracts, but the actual amount that we will get in total in that month is 150k.