Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

alternate states

Hi

Is there a way to make one alternate state inherit from another one?

I want some selections to be valid for the entire document, but one selection i want to only be valid for certain charts. Is there a way to do this?

6 Replies
Anonymous
Not applicable
Author

I do not understand how that helps me.

I have one list box for managers. The selection made in that box should matter for everything else in the document. When a manager is chosen you will get a list of the employees in that office, and you will get a list of everyone of that managers employees that have a birthday in less than 14 days. In the list of employees you can click on one, to select it (this gives you graphs and more information about that employee in different parts of the document). The bad thing is that clicking on an employee also changes the list showing information about the upcoming birthdays. It only shows whether the selected employee has a birthday in less than 14 days or not. However I would like for it to still be showing the upcoming birthday of all the employees with that manager.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You may not need to use alternate states for that. Rather just use an expression in the list box or as a calculated dimension

     =Aggr(Only({<Employee=>} Employee), Employee)

And/or use the {<Employee=>} set filter in your table expression (in a chart or table).

This will prevent the selection of an employee affecting the list box/table

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

yes, I have used that kind of expressions before when i have been using sum or other functions like that in my expression. I can however not make it work with the expression I have written. I get red lines in my expression, and it doesn't work when i try to put {<Employee= >} in it.  My expression in the birthday list is like this:

=If(
If(
  MakeDate(Year(Today()),Month(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')),Day(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')))>=Today(),
  MakeDate(Year(Today()),Month(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')),Day(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')))-Today(),
  MakeDate(Year(addyears(Today(),1)),Month(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')),Day(date(Date#(Employee.BirthDate ,'YYYYMMDD'), 'DD.MM.YYYY')))-Today()
) <=14,
'Have a birthday in less than 14 days'
)


I am using Employee.Name as my dimension. I am making a pivot table.

jonathandienst
Partner - Champion III
Partner - Champion III

In your original post, you asked about selections, which are done on the front end. The load script you have now posted is done during reload. The syntax I posted is for expressions, and will not work in a load script.

So I no longer understand what it is you are trying to do. Perhaps you should rephrase the question in a new post.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

my expression is not in the load script. It is in the expression in my pivot table showing upcoming birtdays