Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ngulliver
Partner - Specialist III
Partner - Specialist III

Alternate States - copying selections in alternate state to default state

Is there a way of copying selection criteria made in alternate states to the default state ? And default state to alternate state ?

This will enable the user to refine their investigations based on previous assumptions.

Thanks,

Neil

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can also use set analysis and use the alternate states as set identifier and / or as scope in your set modifiers, maybe like explained here:

http://community.qlik.com/message/209604

Hope this helps,

Stefan

edited by Sara leslie March 17, 2014 to remove an outdated link.

View solution in original post

14 Replies
swuehl
MVP
MVP

You can also use set analysis and use the alternate states as set identifier and / or as scope in your set modifiers, maybe like explained here:

http://community.qlik.com/message/209604

Hope this helps,

Stefan

edited by Sara leslie March 17, 2014 to remove an outdated link.

ngulliver
Partner - Specialist III
Partner - Specialist III
Author

Hi,

I was looking for something simple like a button.

I created a button, chose 'Copy State Contents' as an action.

In the Source State box I put <default state> and in the Target state box I put the Alternate State name ( I called it State2).

I was expecting the default selection criteria to be transferred to the State2 selection criteria but nothing happened.

Am I missing something ?

Cheers,

Neil

swuehl
MVP
MVP

Try using

$

as default state name in the entry field (just the dollar sign).

Regards,

Stefan

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

For default state I believe the box needs to be left blank.  I modified the demo linked to above and was able to transfer states as required - but on trying exactly the same thing in a different document it did not seem to work.

Odd.

Anonymous
Not applicable

In the last v11.0 version, it works using a blank statement for the Copy State, and Just the name of the altenate state in the 2nd parameter (no = no [] ).

--> But to make it work, I need to have a Current Selection box displaying the Alternate state, and I need to minimize / restore this box to have the copy applied.

--> And after a Copy State action, no other action work, so the minimize / restore can't be in an action.

So I need to try using macro now, it look like the function

     ActiveDocument.TransferState "", "AltState"

or   ActiveDocument.TransferState "$", "AltState"

works except that the script don't like the "" nor "$" and open the Edit Module windows, and if I clik ok or camcel, the function work.

Bug while geting arround a bug while geting arround a bug ?

Anonymous
Not applicable

Hi,

Now I'm using the following macro lauch by a button.

"Items 123" is the Alternate state name to which I copy the current state .

Sub CopyState

set x = ActiveDocument.GetCurrentSelections

s = x.Selections

v = x.VarId

for i = lbound(v) to ubound(v)

   ActiveDocument.Fields(v(i), "Items 123").Select s(i)

          set y = ActiveDocument.GetCurrentSelections("Items 123")

          w = y.VarId

          Flg = 0

          for j = lbound(w) to ubound(w)

             if v(i) = w(j) then

                                 Flg = 1

             end if

          next

   if Flg=0 then

      set z = ActiveDocument.Fields(v(i)).GetSelectedValues(999999999)

               ActiveDocument.Fields(v(i), "Items 123").SelectValues z

   end if           

next

END Sub

Christian_Lauritzen
Partner - Creator II
Partner - Creator II

Hi,

I cannot access the first link? Restricted access...? Can you help?

/C

Email: christian.lauritzen@b3.se
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Me neither.  It may be that it was posted in a group that has subsequently been closed - there has been a bit of a clean up recently.  Perhaps Sara Leslie can advise?

Anonymous
Not applicable

Thanks Steve- I checked the thread and this is from an ask the expert event a while back and has been retired. The thread was valid when the poster originally added it but not now.

I will remove the first link for him.

BR, Sara