5 Replies Latest reply: Feb 3, 2015 4:17 AM by Agis Kalogiannis

# Current Day Sales Vs Previous Day Sales

Good day!

I'm new, sorry

I've read a lot about CurMonth Vs PrevMonth, YoY and so on

But my q. about  Current Day Sales Vs Previous Day Sales

It's so easy from MS PowerPivot, let me understand Qlik Sense and love it

We've got a table to load:

date          dep                      sales
1/1/15          А                          100
2/1/15          А                          110

How can we make this table in Qlik Sense?

date          dep                      Current Day Sales            Previous Day Sales
1/1/15          А                          100                                                  0
2/1/15          А                          110                                                 100

Is it possible?

Thank you very much!!!

Mikhail

• ###### Re: Current Day Sales Vs Previous Day Sales

Hi Mikhail

You can do something like this:

date,

dep,

sales,

previous(sales) AS [Previous Day Sales]

FROM...

ORDER BY date;

This will return null for the first row so you can add an if statement to make it 0

if(isnull(previous(sales)), 0, previous(sales))  AS [Previous Day Sales]

Thanks

Agis

• ###### Re: Current Day Sales Vs Previous Day Sales

Assuming the row above is the previous day, you can also use the chart expression for measure:

above(sum(Sales))

-Rob

• ###### Re: Current Day Sales Vs Previous Day Sales

Generally speaking, to build a solution that covers all possible situations, you should learn how to create Calendar flags in you dataset (or ask your developers to create these flags for you).

Specifically, to satisfy your need to show a Date (Week/Month/Year) as a dimension and to display both Current and Previous Sales, you need to implement a data modeling solution called "As of Table". There are many sources that explain that, including my own blog article at www.naturalsytnergies.com/blog.

cheers,

Oleg Troyansky

Check out my book QlikView Your Business - now available to pre-order on Amazon!

• ###### Re: Current Day Sales Vs Previous Day Sales

thank you very much!

I see how the question can be resolved

I've done it with "previous" method and it works

I see how big is qlik world!!!

• ###### Re: Current Day Sales Vs Previous Day Sales

Hi Mikhail