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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum all values in getfieldselection

Hi All,

I would like to ask for help regarding the getfieldselections.

I am trying to sum the PR_COUNT of all the years that are currently selected. With single selection, it is working but when I am selecting multiple years, it results to ZERO.

Sum({<PRYear={"$(=getfieldselections( YEAR_1 ))"}>} PR_COUNT)

Since we cannot use any dates in the table to filter because it has different dates that may affect the total count, we have created a reference date. We are using YEAR_1 for the filter.

PR_COUNT = Count(PRAPPROVEDDATE)

Is there a way on getting the Sum of the PR_COUNT whenever I selected multiple years. It will combine all the values of the current selections?

[Date]:

LOAD * Inline

[

DATE_1,YEAR_1

09/01/2016,2016

10/01/2016,2016

11/01/2016,2016

12/01/2016,2016

01/01/2017,2017

02/01/2017,2017

03/01/2017,2017

04/01/2017,2017

05/01/2017,2017

];

  

PRMonthPRYearPODatePOMonthPOYearPRAPPROVEDDATE
Mar20165/12/16May20163/17/16
Mar20165/12/16May20163/17/16
Mar20164/12/16Apr20163/17/16
3/11/16
Mar20163/14/16
Mar20163/14/16
Jun20166/21/16
Jun20163/15/17Mar20176/21/16
Jun20166/21/16
Jun20163/15/17Mar20176/21/16
Jun20163/15/17Mar20176/21/16
Jun20163/15/17Mar20176/21/16
Apr201612/6/16Dec20164/18/16
Apr20163/9/17Mar20174/18/16
Apr20164/5/16
Apr20164/5/16
4/4/16
Jun20166/15/16Jun20166/10/16

Thanks,

Renz Rocero

1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

Try this: Sum({<PRYear = p(YEAR_1)>} PR_COUNT)

- Marcus

View solution in original post

1 Reply
marcus_sommer
MVP
MVP

Try this: Sum({<PRYear = p(YEAR_1)>} PR_COUNT)

- Marcus