4 Replies Latest reply: Dec 30, 2013 4:10 AM by Cs Khoo RSS

    QlikView 11 Alternate States: copy a state to another

    Lucian Cotea

      I'm using the following code:


      sub CopyState

           ActiveDocument.TransferState "", "Reference"

      end sub


      to copy current selections to a reference state. In a fresh, empty qvw, it works as expected. So far, so good.


      When I use the code into an existing qvw, assign the macro procedure to a button and press the button, I receive "Error parsing macro, functionality is lost" error.


      But the macro has no error. Through tests, I see that the problem is the first empty parameter "". There's no problem when I use another state name.


      I receive error even using the code: set a = trim(" ")

      Or, is there any other way to reffer to default state? I tried to use "<inherited>", "$", "<default>"... no luck.