Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum - Select - Year less then

Hello.

I Have a table:

YearValue
20011

2002

2
20033
20044
20055
20066
20077
20088
20099
201010

I must create a bar chart, include only 5 years: 2001, 2002, ..., 2006.

I use a sum with select: sum({<Year={XXX}>}Value)

What i must insert instead XXX?

<=2006 not work

Thank you.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Now it's clear:

write this:

sum({<measureName={Opex, Expenditure}, budgetName={"Approved"}, Year={'<=2006'}>}quantity)

let me know

View solution in original post

15 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If year is even a dimension then write in dimension

If(Year<=2006, year, null())

and check the box "Hide null values"

let me know

Not applicable
Author

Thank you, but i have a another formula in my app and "IF" don't work.

Original formula:

sum({<measureName={Opex, Expenditure}, budgetName={"Approved"}, Year={less then needed year}>}quantity)

alexandros17
Partner - Champion III
Partner - Champion III

Now it's clear:

write this:

sum({<measureName={Opex, Expenditure}, budgetName={"Approved"}, Year={'<=2006'}>}quantity)

let me know

maternmi
Creator II
Creator II

Hi,

maybe that helps

sum({<Year={'2001','2002','2003','2004','2005','2006'}>}Value)

BR

Michael

Not applicable
Author

No

"Error in set modifier ad hoc element list"

Anonymous
Not applicable
Author

Hi

Use single quotes '<=2006'

=sum({<Year={'<=2006'}>}Value)

It will work.

Anonymous
Not applicable
Author

Hi,

Try:

Sum({$<Year = {"<=$(=max(Year))"}>} Value)

Not applicable
Author

Sorry. It's work.

Thank you.

alexandros17
Partner - Champion III
Partner - Champion III

Could you mark the answer please?