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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show all dimensions on x-axis

My dimension responsible for the x-axis in my chart is Week.  I have another dimension, CaseType, which plots the lines in my line graph.  My data comes in with either a number for CaseType, or it simply doesn't list the CaseType value if there aren't any for that type of case that week. I would like to show a 0 value on for the Week if the number of Cases is Null.

Dimensions:

     Week

     CateType

My expression is:

     If(IsNull(Cases), 0, Sum(Cases))

     I have also tried the expression:

      Sum(Cases)

I have the following settings for the Week dimension in the Dimensions tab:

     Suppress When Value is Null - enabled

     Show All Values - enabled

     I have also tried displaying with each of these values disabled.

I have the following settings for the Week dimension in the Presentation tab:

     Suppress Zero-Values - disabled

     Zero on bars - disabled

     Suppress Missing - disabled

    

     I have also tried displaying with each of these values enabled

When I set up the axis to be Continuous, it always looks like this for a certain data selection.

Continuous.PNG

When it's not set up to be Continuous, it always looks like this for the same data selection.

Not Continuous.PNG

Any advice?

1 Solution

Accepted Solutions
Not applicable
Author

Thanks!  That helped me to figure out what I was doing wrong.  It's not that 0 values weren't plotting.  It's that the values were completely null.  Example of data I was loading:

Date
Cases
CaseType
1/1/20132A
1/1/20131B
2/1/20134B
3/1/20132A
3/1/20135B
4/1/20132A
5/1/20134A

I changed my LOAD script to include a statement to add a value for every Date for every CaseType of 0 so that when I called on a CaseType for a date, there was always some kind of value, a number or 0.

For anyone with a similar issue, here's the code I used.  (My data begins on 20/6/2012 and ends the day before the LOAD statement runs.)

LOAD Date((MakeDate(2012,6,19) + IterNo())) as Date,

     CaseType,

     '0' as Cases

FROM

(ooxml, embedded labels, table is Sheet1)

While IterNo() <= (Today()-MakeDate(2012,6,20));

View solution in original post

4 Replies
Not applicable
Author

I don't understand what's the exact problem about your graph. Although I think sum(Cases) as expression is correct for what you want.

Not applicable
Author

Here's what I would want/expect it to look like.  Does that help?  If not, what other information would help to explain the issue?

Goal.png

Not applicable
Author

Well, I really don't get you problem but I'll enclose an example of what I'm guessing that you want to achieve.

Not applicable
Author

Thanks!  That helped me to figure out what I was doing wrong.  It's not that 0 values weren't plotting.  It's that the values were completely null.  Example of data I was loading:

Date
Cases
CaseType
1/1/20132A
1/1/20131B
2/1/20134B
3/1/20132A
3/1/20135B
4/1/20132A
5/1/20134A

I changed my LOAD script to include a statement to add a value for every Date for every CaseType of 0 so that when I called on a CaseType for a date, there was always some kind of value, a number or 0.

For anyone with a similar issue, here's the code I used.  (My data begins on 20/6/2012 and ends the day before the LOAD statement runs.)

LOAD Date((MakeDate(2012,6,19) + IterNo())) as Date,

     CaseType,

     '0' as Cases

FROM

(ooxml, embedded labels, table is Sheet1)

While IterNo() <= (Today()-MakeDate(2012,6,20));