Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasmahajan
Champion
Champion

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

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
Champion
Champion

Thanks

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

Vikas

Not applicable

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
Champion
Champion

Can you please modify set analysis demo and send back

thanks

Vikas

Anil_Babu_Samineni

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()?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
klausskalts
Partner
Partner

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?