Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

vikasmahajan
Honored Contributor III

Indirect Set Analysis for P() and E()

Dear all

I have attached my qvw I want to understand what is indirect set analysis how we can use E() and P() both function in my data.

Thanks

Vikas

6 Replies
Not applicable

Re: Indirect Set Analysis for P() and E()

Indirect Set Analysis

• p( ) = Possible

• e( ) = Excluded

Excluded

Possible

Customer = p({<Year={$(=max(Year)-1)}>} Customer)

Returns customers who had an association to last year.

sum(({<Year={$(=max(Year))},

Customer = p({<Year={$(=max(Year)-1)} Customer>}) Sales)

Returns this year’s sales for customers who had sales last year.

Indirect Set Analysis

sum({$<CompanyName = p({$<CategoryName={'Baby Clothes'}>}

CompanyName)>} Sales)

Sales for Customers who purchased Baby Clothes.

The set p({}) returns the values of CompanyName (Customer) that

purchased Baby Clothes.

sum({$<CompanyName = p({$<CategoryName={'Baby Clothes'}>}

CompanyName) - p({$<CategoryName={'SportsWear'}>}

CompanyName)>} Sales)

Sales for Customers who purchased Baby Clothes but not

Sportswear.The first set p({}) returns CompanyName that purchased

Baby Clothes.The second set p({}) returns CompanyName that

Purchased SportsWear.The Unary Operator "-" between the two gives

a list of Customers (CompanyName)that belong to the first but not the

other set.

vikasmahajan
Honored Contributor III

Re: Indirect Set Analysis for P() and E()

Thanks

can you explain me please put this expressions in qvw and attach.

Vikas

Not applicable

Re: Indirect Set Analysis for P() and E()

iN SCRIPT-

 
LOAD date_field,
day(date_field) as day,
Month(date_field) as month,
Year(date_field) as year,
sales
FROM TABLE

Dimension- year

EXPRESSION--

sum( {$<year = E({1<year={"*09*"}>})>} sales) //Excluded Sale

********************************

Dimension- year

EXPRESSION--

sum( {$<year = P({1<year={"*09*"}>})>} sales) //Possible Sale

vikasmahajan
Honored Contributor III

Re: Indirect Set Analysis for P() and E()

Can you please modify set analysis demo and send back

thanks

Vikas

Re: Indirect Set Analysis for P() and E()

i am also Confused,

We can write like this

Sum({<Year -= {"*09*"} Sales)

Instead of this.

sum( {$<year = E({1<year={"*09*"}>})>} sales)


Can you explain, Which scenario we are using P() and E()?

Life is so rich, and we need to respect to the life !!!
klausskalts
Contributor

Re: Indirect Set Analysis for P() and E()

What you are doing is entering a 'normal' Set Analysis formula. That is used for direct selection of transctions to include in the calcullation of an expression - e.g. all transaktions in the years containing the value 09 (in your example).

P & E are used for inderect selections. e.g.

  1. Show all sales for customers which have bought a specific product.
  2. Show all sales for customers which have not bought a specific product.
  3. Show all sales for customers which have bought a specifik product but NOT bought another specific product

etc .......

Makes sense?

Community Browser