6 Replies Latest reply: Apr 19, 2017 3:36 AM by Klaus Skalts RSS

    Indirect Set Analysis for P() and E()

    vikas mahajan

      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

        • Re: Indirect Set Analysis for P() and E()
          Vishwaranjan Kumar

          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.

          • Re: Indirect Set Analysis for P() and E()
            Vishwaranjan Kumar

            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