4 Replies Latest reply: Feb 9, 2016 12:11 PM by Hemang Dave RSS

    p function in set analysis

    Hemang Dave

      Hi

       

      I am using following set analysis and noticed that the bolded line of code is not interpreting. Could someone guide as to what I am missing here? Qlik sense is not throwing any code error but it is just not interpreting this line of code..!

       

      Sum({1 < rating_analyst_code = {$(=rating_analyst_code)},

                    security_id_effective_date2 = p(security_id_effective_date), //As user selects effective date, security_id_effective_date gets                                                                                                              filtered with stocks & effective date combinations which is passed                                                                                                          into security_id_effective_date2

                    history_rating_analyst_code = p(rating_analyst_code),       //As user selects rating_analyst_code it is passed into                                                                                                                            history_rating_analyst_code. This enables filtering down to                                                                                                                   stocks covered by the analyst at a point in time.

                      parent_clone_type={'Parent'}

            >}

      benchmark_contrib_mktval_weight)

       

      Thanks

        • Re: p function in set analysis
          Sunny Talwar

          I am guessing that the only bold part of the set analysis isn't working the way you would expect? Have you tried using just that as your set analysis and see if it work the way you would expect?

           

          Sum({1<history_rating_analyst_code = p(rating_analyst_code), rating_analyst_code>} benchmark_contrib_mktval_weight)

           

          Is the above working properly with user selection in rating_analyst code?

          • Re: p function in set analysis
            Stefan Wühl

            You are setting the same value to rating_analyst_code and history_rating_analyst_code, is this what you want?

             

            If you make the selections in filter pane with just sum(benchmark_contrib_mktval_weight) as expression, do you get the correct result?

             

            It's quite hard to answer why something is not working, without knowing the context. If possible, post a small sample.

              • Re: p function in set analysis
                Hemang Dave

                Hi Swuehl

                 

                Yes, i need to set the same value to rating_analyst_code and history_rating_analyst_code.

                This is because of the way the data model is structured.

                 

                If you make the selections in filter pane with just sum(benchmark_contrib_mktval_weight) as expression, do you get the correct result?

                Yes


                Unfortunately can't share the data model but the problem is clear, i.e. the following line of code is not interpreting.


                history_rating_analyst_code = p(rating_analyst_code)


                The complete set analysis code is as follows.


                Sum({1 <   parent_clone_type={'Parent'},

                                 history_rating_contact_id = p(rating_contact_id),

                                 security_id_effective_date2 = p(security_id_effective_date)

                        >}

                benchmark_contrib_mktval_weight)