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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Remco
Contributor III
Contributor III

Another question with Alternate States

You guys make my learning curve go quick! Thanks!

But here we go again, another question.

I have 2 states, each one has a selected value so I just get 2 dimensions if I do the following:

=Aggr(only({[State A] + [State B]} FORECASTID),FORECASTID)

This works great and I can make a simple count  of a field 'IDCONTRACT' or whatever measure:

Capture.JPG

 What I want to do is split up in 4 lines:

1) ID 209 and where IDCONTRACT is in both State A and State B

2) ID 437 and where IDCONTRACT is in both State B and State A

2) ID 209 and where IDCONTRACT is in State A but not in State B

3) ID 437 and where IDCONTRACT is in State B but not in State A

meaning that there must be a column between ID (that is the FORECASTID in the example above) and Count (counting the IDCONTRACT's)

 

Who could give me a clue of how to proceed?

 

Thanks!

Labels (3)
1 Solution

Accepted Solutions
Remco
Contributor III
Contributor III
Author

Never mind, I solved it:

=if(aggr(only({[State B]} IDCONTRACT),IDCONTRACT) = aggr(only({[State A]} IDCONTRACT),IDCONTRACT),'Continued Business',
if(aggr(only({[State A] + [State B]} IDCONTRACT),IDCONTRACT) = aggr(only({[State A]} IDCONTRACT),IDCONTRACT),'New Business',
'Discontinued Business'
)
)

View solution in original post

1 Reply
Remco
Contributor III
Contributor III
Author

Never mind, I solved it:

=if(aggr(only({[State B]} IDCONTRACT),IDCONTRACT) = aggr(only({[State A]} IDCONTRACT),IDCONTRACT),'Continued Business',
if(aggr(only({[State A] + [State B]} IDCONTRACT),IDCONTRACT) = aggr(only({[State A]} IDCONTRACT),IDCONTRACT),'New Business',
'Discontinued Business'
)
)