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: 
rebelfox
Creator
Creator

Line Chart Time And Conditional Value

I have a table that has a month/year column and it has a single quantity column that holds a value that can be anything from 0 to 999.

I want one line on my chart to show the count of rows with a value of  0 over time.

The dimension is straight forward as it is a time dimension against a calendar.

The expression I am not clear how to code an expression to only count rows where the quantity column is 0.

Can anybody advise?

Thanks

1 Solution

Accepted Solutions
ziadm
Specialist
Specialist

use set Analysis is your expression

assuming this is your Table

Load * Inline [

Date, Quantity

01-05-2016, 1

01-05-2016, 0

02-05-2016, 0

03-05-2016, 1

03-05-2016, 0

];

in you line chart your dimension should be Date

and you expression should be

Count({<Quantity= {0} >} Date)

View solution in original post

2 Replies
ziadm
Specialist
Specialist

use set Analysis is your expression

assuming this is your Table

Load * Inline [

Date, Quantity

01-05-2016, 1

01-05-2016, 0

02-05-2016, 0

03-05-2016, 1

03-05-2016, 0

];

in you line chart your dimension should be Date

and you expression should be

Count({<Quantity= {0} >} Date)

rebelfox
Creator
Creator
Author

Took me a while to confirm the results but yes that does the trick.

Many thanks.