Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show transaction even if value is zero

Hi

I have the following sales data per day below.  Sales do not occur everyday, hence i created a Calendar.

How do i create a chart table to show transactions for the day before even though the value is zero.

So for example, the max date is 13th July, then i want to sales for the 12th July.

I've untick the box suppress zero and in dimensions show all values, but i cant get it right.

Kind regards

Nayan

 

DateAmount
21-May700
24-May900
25-May1000
27-May400
28-May700
31-May200
01-Jun200
02-Jun500
03-Jun200
06-Jun200
10-Jun1000
11-Jun300
12-Jun400
15-Jun700
16-Jun700
17-Jun200
21-Jun900
22-Jun900
23-Jun700
24-Jun500
25-Jun1000
30-Jun600
02-Jul900
03-Jul300
04-Jul100
09-Jul100
10-Jul500
11-Jul400
13-Jul600
8 Replies
lironbaram
Partner - Master III
Partner - Master III

in order to display dates with zero

you'll need to create a calendar that have this dates

your script should look something like this :

Data:

LOAD Date,

     Amount

FROM

(ooxml, embedded labels, table is Sheet1);

Calendar:

load date(start+IterNo()-1) AS Date

While date(start+IterNo()-1)<=end;

load min(Date) as start,

     max(Date) As end

resident Data;

Frank_Hartmann
Master II
Master II

attached sample might be helpful

effinty2112
Master
Master

Hi Nayan,

          This trick might work for you.With Suppress zero values unchecked as you have done already, replace the expression

sum(Amount)

with

sum(Amount) + Sum({1}0)

Good luck

Andrew

Anonymous
Not applicable
Author

Thank you for your reply.  I have created a Calendar, the issue I'm having is on the front end to get the Sales for the previous day.  So if I select a Sales manager and if he sold nothing the day before, i want to info to only show the date for yesterday, even though the value is zero.

Kind regards

Nayan

Anonymous
Not applicable
Author

Hi Frank

Thank you for your reply.   I have similar result to your QV Model and as mentioned above to Liron, i only require the day before sales, even though the value is zero.

Kind regards

Nayan

Anonymous
Not applicable
Author

Hi Andrew

Thank you for your reply.  Your solution is on the right track, however its showing all dates. In this screenshot i only want to show 2017/07/17.

Kind regards

Nayan

Screenshot - Last Day.jpg

Please note that the actual screenshot of the model I'm working with and different to the sample data I've given

effinty2112
Master
Master

Hi Nayan,

Try:

=sum(Amount) + sum({<Date = {'$(=only(Date))'}>}0)

Cheers

Andrew

Anonymous
Not applicable
Author

Hi Andrew

Thank you.  It works.  However is there a way to show the date, in this case the 2017/07/17. Also want to add in to say "No transactions for processed.

Kind regards

Nayan

Screenshot - Last Day 2.jpg