Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
varmekontrol
Creator
Creator

Missing values on time dimension bar-chart

I know this has been discussed in many threads in this community, but I still am unable to figure out the simplest way to solve my problem. 

I have dates = time(created) 
I have sales = count(sales) 

I would like to see on a 24 hour basis time(created) all count(sales) even if there is none.

//I know there is something like this
if(isnull(created),' ',sales)

//If I need to make a table or bar-chart on a specific period i need to.
sum(if(created>=today(), sales)) //But how to get the null values?

//like this? 
sum(if(isnull(created>=today(), sales)), ' ', sales)) //this does not work. 

What I have  (imagine a barchart 🙂

createdsales
08:002
11:003
15:007

 

what i want 

createdsales
00:00 
01:00 
02:00 
03:00 
04:00 
05:00 
06:00 
07:00 
08:002
09:00 
10:00 
11:003
12:00 
13:00 
14:00 
15:007
16:00 
17:00 
18:00 
19:00 
20:00 
21:00 
22:00 
23:00 
Labels (1)
3 Replies
jyothish8807
Master II
Master II

Hi Varme,

May be like this:

Best Regards,
KC
varmekontrol
Creator
Creator
Author

@jyothish8807  

Thank you for your reply. I am using a personal edition and have no keys left to open other .qvw files. Could you maybe post the script of a screenshot for your solution?

Thanks in advance.

jyothish8807
Master II
Master II

Try this:

Script:

Inline:
LOAD * INLINE [
created
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
];

Data:
LOAD * INLINE [
created, sale
08:00, 2
11:00, 3
15:00, 7
];

 

On UI: Create a Bar chart:

Dimension: Created

Expression: sum(sale)

From presentation tab, uncheck suppress zero value 

Capture.PNG

Best Regards,
KC