# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Valued Contributor

## 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!

13 Replies
Esteemed Contributor

## 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 :

Valued Contributor

## 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.

Esteemed Contributor

## 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)
Valued Contributor

## 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.

Esteemed Contributor

## 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

Valued Contributor

## 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.

Valued Contributor

## 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 ?

Esteemed Contributor

## 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?

Valued Contributor

## 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.