Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ajipaul03
Contributor III
Contributor III

Set Analysis help with p() function

Hello Experts,

I have this expression

sum(  {<TEST_CODE= p(MAX_Days)  >}      TEST_VOL  )  - the intend is to limit to all possible TEST_CODE values for the selection in MAX_Days. I am not sure whats wrong with this expression, but it returns 0

For testing, I've hard-coded a value and it works just fine.

sum(   {<    TEST_CODE= p( {<MAX_Days={10}> } )   >}     TEST_VOL)

 

Any idea?

 

Thanks,

Aji

Labels (2)
1 Solution

Accepted Solutions
Arthur_Fong
Partner
Partner

Try this:

sum( {<TEST_CODE= p(TEST_CODE),MAX_Days>} TEST_VOL )

View solution in original post

8 Replies
ajipaul03
Contributor III
Contributor III
Author

 

 

BTW the expression is

 

sum( {<TEST_CODE= p(MAX_Days), MAX_Days >} TEST_VOL )

Arthur_Fong
Partner
Partner

Does this expression:

sum( {< MAX_Days={"$(=max(MAX_Days))"} >} TEST_VOL )

differ from your expected result?

 

ajipaul03
Contributor III
Contributor III
Author

nope.. it doesn't work

Arthur_Fong
Partner
Partner

Arthur_Fong
Partner
Partner

Try this:

sum( {<TEST_CODE= p(MAX_Days), TEST_CODE>} TEST_VOL )

ajipaul03
Contributor III
Contributor III
Author

Thanks for the suggestion .
Unfortunately this doesn't get what I am looking for
What I really need is, once the user make selection in MAX_Days, the expression calculates the TOT_VOL all the TEST_CODEs that has the selected MAX_days.

ex. if I select 5, it will limit to REF 2  and 4 in TABLE 2 ( blue color). Where as I want to find the SUM(TOT_VOL) for all B&D TEST_CODES ( Blue and Red)

 

TABLE 1

REFMAX_Days
120
25
340
45
510
620

 

TABLE 2

REFTEST_CODETEST_VOL
1A5
1A6
1A7
1A8
2B6
2B8
3C3
3C4
3C5
4D3
4D2
5B20
5B1
6D1
6D4
6D2
Arthur_Fong
Partner
Partner

Try this:

sum( {<TEST_CODE= p(TEST_CODE),MAX_Days>} TEST_VOL )

Arthur_Fong
Partner
Partner

clipboard_image_0.png