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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

p() in set analysis

I am trying to understand how p() works.

Is Sum({1<[Date]=P([Date]), [Hour]=P([Hour])>} [Value]) the same as Sum([Value])?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Either I mis-read your reply, or you've edited it (?)

Yes - "ignore all selections except possible values in Date and Hour".

Flat table - I assume so too.

View solution in original post

7 Replies
Anonymous
Not applicable
Author

The pdf in this link explains Set Analysis,

     Set Analysis: syntaxes, examples

But in essence the 1 ignores any selections made and the P() returns all the possible values.

Not applicable
Author

Yah, I guess that's my question - by ignoring all selections am I already including all possible values?


Basically is [Date]=P([Date]) a subset of all my possible selections based off what I have selected - I am curious if the expression I first wrote is redundant?

Anonymous
Not applicable
Author

It is not the same.  It will sum up the values for Date and Hour which are affected by selections in other fields.

Not applicable
Author

So the expression is stating - ignore all selections except possible values in Date and Hour?

If the data set was flat would that make it the same as sum([Value]) ?

Anonymous
Not applicable
Author

Close enough but not exactly.  Certainly direct selections in Date and Hour will not be ignored.  But "indirect selections" in Date and Hour made by selections in other fields will not be ignored either.

For example, you select a completely different field, say Product.  The selection of the Product is not going to affect the result directly, because of {1}.  But if the Product selection changes what Date and Hour values are available, the result will affected.


Anonymous
Not applicable
Author

Either I mis-read your reply, or you've edited it (?)

Yes - "ignore all selections except possible values in Date and Hour".

Flat table - I assume so too.

Not applicable
Author

Yah, I edited it - same reasoning as your previous statement.  This has helped me understand - thank you!