Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
senarath
Creator III
Creator III

Alternate state in set analysis

Hi,

I want to create a comparison between two states (StateA and StateB) for below expression.

Appreciate if anybody could help me out to complete the formula using states

Let's assume Dim is Company.

Sum({$<[Business Date]={'>=$(=Date(vStartDate)) <=$(=Date(vEndDate))'},[Boat Name]=,Type={Actual},Year=,Quarter=,Month=,Week=,Day=>} [Cruise Nights])

Thanks

Senarath

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi, which fields of yours are in alternate states?

If all of them, you can try

Sum({[StateA]}<[Business Date]={'>=$(=Date(vStartDate)) <=$(=Date(vEndDate))'},[Boat Name]=,Type={Actual},Year=,Quarter=,Month=,Week=,Day=>} [Cruise Nights])

versus

Sum({[StateB] }<[Business Date]={'>=$(=Date(vStartDate)) <=$(=Date(vEndDate))'},[Boat Name]=,Type={Actual},Year=,Quarter=,Month=,Week=,Day=>} [Cruise Nights])


If some of fields are in ordinary state you can use in set analysis a syntax like Year=$::Year


This one for your reference:

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


KR

Elena

View solution in original post

5 Replies
Anonymous
Not applicable

Hi, which fields of yours are in alternate states?

If all of them, you can try

Sum({[StateA]}<[Business Date]={'>=$(=Date(vStartDate)) <=$(=Date(vEndDate))'},[Boat Name]=,Type={Actual},Year=,Quarter=,Month=,Week=,Day=>} [Cruise Nights])

versus

Sum({[StateB] }<[Business Date]={'>=$(=Date(vStartDate)) <=$(=Date(vEndDate))'},[Boat Name]=,Type={Actual},Year=,Quarter=,Month=,Week=,Day=>} [Cruise Nights])


If some of fields are in ordinary state you can use in set analysis a syntax like Year=$::Year


This one for your reference:

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


KR

Elena

senarath
Creator III
Creator III
Author

Hi Elena,

I tried what you have mentioned. But what I do not understand is how to apply $:: to other expanded areas.

I had read your link as well and still I do not clear as to how to apply $::.

Thanx

Not applicable

The :: denotes a linkage between the fields, so it works in a similar way as to using P(). As an example, if you have a company field that you wish to apply the alternate state to, it would be

Company = State1::Company.

The dollar sign in this instance simply ties back to the base state selections.

Not applicable

Hi Senarath,

have a look at

http://community.qlik.com/docs/DOC-4951

provides good info on set analysis and has a section on using alternate states, which should prove useful to you

hope that helps

Joe

senarath
Creator III
Creator III
Author

Thanks a lot all...really helpful notes....!!!!