Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Displaying unselect field in chart

Hi have a line chart where dimension is Hour. So on X axis we display hours from 1 to 24 and on Y axis we display count of service in each hour. My requirement is that if we select any date range where no data is there then also on x axis the hours should de displayed.

I tried following expression in dimension but then also if i select a date range where no service is there the X axis label also goes.

=if(GetPossibleCount([Hour 12]) =0,aggr(only({1-$} [Hour 12]),[Hour 12]),if([Hour 12] = '0 AM','12 AM',if([Hour 12] = '12 AM', '12 PM',[Hour 12])))

Any help would be appreciated.

Thanks

-Avi

5 Replies
tresesco
MVP
MVP

It would be easier to spot the issue, if you could share a sample app.

simondachstr
Luminary Alumni
Luminary Alumni

Try adding +0 to your expression.

e.g. sum(Sales)+0.

This way, if no entries are available in Sales, it will still show 0 instead of null().

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

It is easier and better performing to address this in your data model.

Have a look at these blog postings for ways to do this:

http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/12/reference-dates

http://community.qlik.com/docs/DOC-3786

These show some of the best ways to handle missing data in Qlikview

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Martin,

I tried adding 0 but it didn't worked

Not applicable
Author

Hi Jonathan,

Thanks for the links. Actually right now i am looking for a quick fix as i need to complete it today for demo. But i will surely go through the pdf to for permanent fix