4 Replies Latest reply: Jan 18, 2013 9:54 AM by Amitesh Modi RSS

    Show/Hide Search Box

      Hi,

      I have a check box filter with three values (A,B,C) that conditionally shows/hides a 2 charts and also 2 search boxes. The link to my original post is given below in new to QlikView.

        http://community.qlik.com/message/289078#289078

       

      In one of the charts there is a cyclic drill through which has  1. Parent Company    2. 'Child ID-Child Name'.

      When Parent Company is shown as the dimension in the chart, the search box also shows Parent Company. I have a requirement from the users that when users drill through(/down)  to the Child Level the Search box should show ONLY the child level i.e. basically a third search box should replace the 1st one  

       

      First search box show condition is

      =if(match(GetFieldSelections(Group),'A','B','A, B'),1,0)

      Second search box show condition is

      =if(match(GetFieldSelections(Group),'A','B','A, B'),0,1)

       

      Is it possible to communicate the drill through action to the search box?

      If so, what would be the syntax of the show condition if the child dimension used in the drill through is  'Child ID-Child Name'.  

       

      It could possibly be something like

      =if(match(GetFieldSelections(Group),'A','B','A, B'),

      if(<Cyclic Drill Through Level=Child>),1,0)

       

      Any response would be highly appreciated.

       

      Thank you

      AM

        • Re: Show/Hide Search Box
          Fernando Suzuki

          You can use the GetCurrentField() function to identify which field is currently in use in the group.

           

          The syntax is:

          =GetCurrentField(groupname)

           

          inside the parenthesis you just have to insert the group name, without any quotes. It will return the name of the current field being used.

           

           

           

          Hope this helps

          Fernando

            • Re: Show/Hide Search Box

              Hi Fernando,

              Thanks for your response. I tried using =GetCurrentField([Cyclic Group]) in a text box and it shows me my current selection from the drill through. But I'm having issues being able to incorporate this function in my conditional show /hide expression. If you could help me perfect that I would be extremely grateful.

               

              Currently my expression which is not working as expected is:

              =if(match(GetFieldSelections(Group),'A','B','A, B'),
              if(GetCurrentField([Cyclic Group])= {'Parent Group'} ) ,1,0)

               

              The Expression Editor is saying error in expression for [Cyclic Group], but the same evaluates fine in the text box.

               

              What I intend to happen is when Condition A (match(GetFieldSelections())) and Condition B (GetCurrentField()="XYZ") are true, only then display the searchbox.

               

              Please help.

               

              Thanks,

              AM

                • Re: Show/Hide Search Box
                  Fernando Suzuki

                  Don't mind the syntax error, QV doesn't understand it but it will surely work.

                   

                  Try this:

                  =if(match(GetFieldSelections(Group),'A','B','A, B') and GetCurrentField([Cyclic Group])= 'Parent Group', 1, 0)

                    • Re: Show/Hide Search Box

                      Thanks a million Fernando,

                      Yes!!! It worked.

                      I had one Search box working but the child searchbox (for Child ID&'-'&Child Name') was not working due to the fact that it had single quotes. But I reversed the logic of the first one and it worked.

                       

                      Escape Characters: I researched a little bit but found people saying that there is really no good way to handle escape characters and try to work around it. That is what I did.

                       

                      Thanks again

                      AM