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

how do I know which field has an alternate state on it

Dear Qlikview User

I have assigned an alternate state so that one particular graph does not interact with the Field YearStart. I also want to adapt the expression so that it does not interact with the Month field also

My expression is like this at the moment, however in order for it not to interact with the Month field, do I need to add another alternate state and if so, how would I amend the expression to incorporate the second alternate state

Count(YearStart= Date_State :: YearStart,ID)

Any help would be greatly appreciated

Thanks

Helen

1 Solution

Accepted Solutions
sunny_talwar

helen_pip‌ -

I am not entirely sure why you would want to complicate things, why can't you just do this?

Count({<Month, YearStart, QuarterName, FactDateNum = {">=$(=Today()-7)<=$(=Today()-1)"}>} ID)

View solution in original post

7 Replies
swuehl
MVP
MVP

I don't fully understand what you are trying to achieve.

Your syntax in the expression is not correct, I think it should look like

Count( {<YearStart= Date_State :: YearStart >} ID)


So maybe you need something like


=Count( {<YearStart= Date_State :: YearStart, Month = Month_State::Month >} ID)


You can also set the alternate state as identifier (instead of inherited state and then modify only one state:

=Count( {Date_State<Month = Month_State::Month >} ID)


But I am not really sure what you want to do here.

sunny_talwar

If you are looking to ignore selections in Year and Month field, why do you even need alternate state? May be try this

Count({<YearStart, Month>}ID)

helen_pip
Creator III
Creator III
Author

Thanks Sunny

This could work for me. I shall try this

Thanks

Helen

helen_pip
Creator III
Creator III
Author

Hello Stefan

I am fairly new to alternate states, so thank you for help with amending my expression,  I shall try your technique

Thanks

Helen

helen_pip
Creator III
Creator III
Author

Hello Stefan

It has been a few days, but I have been playing around with your suggestion.  What I am trying to achieve is an expression which interacts with all my list boxes, except the Year, Quarter and Month list boxes.  The reason why I do not want the expression to interact with these list boxes is because I always want to show data for the last 7 days

Your suggestion works perfectly fine until I try and add in my extra code {$<FactDateNum={">=$(=Today()-7)<=$(=Today()-1)"}>}, which is counting data for the last 7 days

My question to you is, as Month, YearStart, QuarterName and FactDateNum are all coming from the master calendar, could this be the reason why the alternate state is not working when I am adding in the extra line of code?

Count({Month_State<Month = Month_State::Month>}{Year_State<YearStart = Year_State::YearStart>} {Quarter_State< QuarterName = Quarter_State:: QuarterName>}
{$<
FactDateNum={">=$(=Today()-7)<=$(=Today()-1)"}>}ID)

sunny_talwar

helen_pip‌ -

I am not entirely sure why you would want to complicate things, why can't you just do this?

Count({<Month, YearStart, QuarterName, FactDateNum = {">=$(=Today()-7)<=$(=Today()-1)"}>} ID)

helen_pip
Creator III
Creator III
Author

Hello Sunny

Thank you, this does exactly what I need.  I think I lacked understanding, but now I can see how this works

Thanks for your help