Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
alisonpwallis
Creator
Creator

Alternate States and Selections

Hi,

I am using alternate states to compare two groups of data. I am comparing the programs of study offered by some other universities with the ones that we offer at our university. This is working but I now want to compare this data for two years. I have a list box for the main state with the two years and a list box with the alternate state for the two years (using the same field in the data) and I can select the same year in both but I wanted to know if there was a way of making it so I can ONLY select the same year for both states. Currently, it means you could compare 2012-13 for our university with 2012-13 OR 2013-14 with the others (or vice versa) - which is very confusing for users. Is there a way I can make the listbox for one of the states automatically select the same value as the listbox for the other state?Any help would be much appreciated!

Thanks

Alison

10 Replies
swuehl
MVP
MVP

Instead of offering a list box with a no real selection left for the user, why not use one list box to select the year and copy the selection from the default state to the alternate state, using something like:

=count({AS<Year = $::Year>} Date)

alisonpwallis
Creator
Creator
Author

Hi Swuehl,

Thanks for the reply. I think I understand the idea - but without a listbox, where would I put this calculation so it applies to the alternate state? And also, what do the :: mean in the calculation?

Thanks again for your help.

Alison

jvitantonio
Luminary Alumni
Luminary Alumni

Hi Alison,

:: in your set analysis means "Select in the Year field for my alternate state, the same year as I select in my defaul state. That why you have $ in front of ::, because you want to use the Year in your defaul state.

JV

BI Experience | A place to share our Business Intelligence experiences

swuehl
MVP
MVP

You would still use one list box for year, applying this selection to both states.

Please check attached sample.

GabrielAraya
Employee
Employee

Hi Alison ... one option is using macros ...enclosed an example ...

Good Luck

andrewpettit
Partner - Creator
Partner - Creator

I would recommend using set analysis as described above to apply the year selection from the default state to the alternate state in the chart expressions.

Or you could attempt to set the selection in the alternate state using triggered actions.

I would reserve anything using macros as a last result since they are typically considered bad practice, due to the common belief that they will eventually be phased out of the QlikView product, as well as the fact that they do not always behave the same in AJAX as they do in Desktop.

alisonpwallis
Creator
Creator
Author

Hi Everyone

Thank you very much for your replies. I understand the Alternate State much better now. I think the problem is that I am trying to restrict a list box on the basis of the selection rather than create a chart. I have a list box which allows the user to select the year and then I want them to only be able to select the data in a further list box based on the entries for that year. I have two problems - first the year is a calculation (trimming some data off the end of an existing field) which seems to be causing problems. Second, although I've tried limiting the list box using an Expression (which has the set analysis in it as recommended by you all) rather than the relevant  field it just doesn't show anything at all.

Thanks for your help - I really appreciate it!

Alison

swuehl
MVP
MVP

Alison,

could you upload a small sample file? Upload option is available in advanced editor.

alisonpwallis
Creator
Creator
Author

Hi Swuehl

Thanks for your help. Unfortunately, I can't load a sample file - I've just been trying to create a sample and not been able to do it (and I have to go now unfortunately). The data comes from an xml file which I can't really make smaller very easily or quickly and then there are around 10 QVD files created. The data in total is around 1,000,000 records.

I'll keep trying with the set analysis. Thanks for your suggestions - I just need to work out how to apply them!

Thanks

Alison