Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

expression that only allows certain field selections to affect it

I have an expression:

SUM({1<sg.yearmonth= $:: sg.yearmonth>}sg.cost)

This makes it so the only selections that can affect the results are from the sg.yearmonth list box.

I would like to add to that sg.year as well

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Sum({1<sg.yearmonth= $:: sg.yearmonth, sg.year = $::sg.year>} sg.cost)

View solution in original post

9 Replies
sunny_talwar

May be this:

Sum({1<sg.yearmonth= $:: sg.yearmonth, sg.year = $::sg.year>} sg.cost)

adamdavi3s
Master
Master

IS it not just

SUM({1<sg.yearmonth= $:: sg.yearmonth,sg.year>}sg.cost)


I've not used to the $:: notation but simply separating with a comma is the usual way for adding things to set

adamdavi3s
Master
Master

Sunny what does the $:: notation do?

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

Try this:

=SUM({1<sg.yearmonth= $:: sg.yearmonth, sg.year= $:: sg.year>}sg.cost)

If that doesn't work, please send us a QVW sample or data sample and a further explanation...

Best regards,

D.A. MB

sunny_talwar

Adam without $:: ... You are ignoring the selection in those fields (which is currently getting handled by 1). This is doing the exact opposite of that. ignore selection in everything except sg.yearmonth and sg.year

matthewp
Creator III
Creator III
Author

Almost perfect Sunny

Just missed the '='

Sum({1<sg.yearmonth= $:: sg.yearmonth, sg.year= $:: sg.year>} sg.cost)

adamdavi3s
Master
Master

Hi Sunny,

Cool, so its just a fixed notation to be aware of then

somefield = $:: somefield

Handy to know thank you.

sunny_talwar

Its added now

sunny_talwar

Yup, you got it