7 Replies Latest reply: May 31, 2017 4:55 AM by Lech Miszkiewicz RSS

    Nprinting 17 ignoring selected values in qvw ?

    Johan Kruize

      In Nprinting I created a report from a qvw that uses variables in expressions.(set analysis)

       

      In Nprinting 17 I cannot find any possibilities to use this variable in a filter.

       

      It looks like Nprinting 17 does not use the selected listbox values so the variable does not gets the right value.

      Is there another way to get a value to this variable ?

        • Re: Nprinting 17 ignoring selected values in qvw ?
          Lech Miszkiewicz

          Hi,

          what is in your listbox text? number or dual value (text & number - for example month (Jan for text or 1 for number)

           

          make sure you use filters according to their types: see this for detailed information (slightly differnet topic but i guess your problem is datatype when trying to apply filter):

          https://community.qlik.com/message/1268669?et=watches.email.thread#1268669

           

          also make sure your variable expression starts with "=" sign so it can get evaluate on each selection.

           

          cheers

          Lech

          ---------------------------------------------

          When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

            • Re: Nprinting 17 ignoring selected values in qvw ?
              Johan Kruize

              In my listbox there is an expression :

              =if(Period_num > 0 ,if(Period_num < 13,Period_num))

               

              Then I have a variable selected_period : max(period)

               

              In my qvw I have two expressions using selected_period :

              Sum({$<Period_num = {"<= $(selected_period)"}>}[amount]

              and

              Sum( if(Period_num = $(selected_period),[amount],0))

               

              The qvw works fine, and I would not like to have to rebuild it ofr Nprinting.

              I think the problem is that in Nprinting the variable selected_period does not get a value ?

               

                • Re: Nprinting 17 ignoring selected values in qvw ?
                  Lech Miszkiewicz

                  Hi - My comments in RED (sorry - bit messy)

                   

                  In my listbox there is an expression :

                  =if(Period_num > 0 ,if(Period_num < 13,Period_num))

                  (why dont you create in you datamodel "new field" which already has this condition calculated (so it will only contain values and records linked to values from 1-12)? and then apply NPrinting filter on it using simple =max("newfield"))

                   

                  Then I have a variable selected_period : max(period)

                  (is it max(period) ??? where is period coming from? is it another field?

                  or it is max(Period_num)?


                  i would suggest to use following: selected_period : =max(newfield) - notice"=" sign before my variable, which evaluates variable on each "click"

                   

                  In my qvw I have two expressions using selected_period :

                  Sum({$<Period_num = {"<= $(selected_period)"}>}[amount])

                  and

                  Sum( if(Period_num = $(selected_period),[amount],0))

                  (this will then work without issues)

                   

                  The qvw works fine, and I would not like to have to rebuild it ofr Nprinting.

                  I think the problem is that in Nprinting the variable selected_period does not get a value ?

                  like i said

                  • simplify it!
                  • create new field calcualted in datamodel  if(Period_num > 0 ,if(Period_num < 13,Period_num)) as newfield
                  • change your variable to be selected_period : =max(newfield)

                   

                  cheers

                  Lech