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: 
delbooth
Contributor II
Contributor II

Histogram

Hi.

I am trying to create a histogram.  I have used the field data Quantity_Collected in the data part and it gives me a histogram of all the data points.  If I want to limit it to the year 2018 and other criteria such as collection code, how do you do it.  i have tried:

Sum({<ColYear={"$(=year(Today()))"}, [Collection Code]-={'Z','D'}>}[Quantity_Collected]  It returns invalid dimension

Thanks

Del

5 Replies
zebhashmi
Specialist
Specialist

what about

Sum({<ColYear={"=year(Today())"}, [Collection Code]-={'Z','D'}>}[Quantity_Collected]

tulabandula
Partner - Contributor III
Partner - Contributor III

Try this

Sum({$<

ColYear={"=year(Today())"},

[Collection Code]={'*')-{'Z','D'}>}Quantity_Collected)


Or else

create a variable Year(today()) for 2018 and use in an expression.

Quy_Nguyen
Specialist
Specialist

Try this:

If(ColYear = Year(Today()) and [Collection Code] <> 'Z' and [Collection Code] <>'D', [Quantity_Collected] )

delbooth
Contributor II
Contributor II
Author

Thanks all for your comments, the only one that does not retun invalid dimension is :

If(ColYear = Year(Today()) and [Collection Code] <> 'Z' and [Collection Code] <>'D', [Quantity_Collected] ) but it returns  - The chart is not displayed because it contains only undefined values

Quy_Nguyen
Specialist
Specialist

May i have your sample data or app? My expression is based on the expression on your post.