Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help creating a Cross Table with Alternate States

We want to create a cross table that compares the same dimension over alternate states.  We would like the result to be the following:

1Header 2Header 3Header 4Header 5
[AlternateState2] DrugY
SRI
[AlternateState1] DrugXS

47201

159363067
R14204340269559
I549010264002



Background:

We have a list of Drugs loaded into ClickView.  Each drug has a breakdown of Interpretations (either S, R, or I).  We use the following formula to give us a count of interpretations:


(aggr(count(interpretation), interpretation))


This yields the following list box:


DrugX

S — 24064

R — 12711

I — 4982



We’ve created 2 alternate states, allowing us to compare interpretations of 2 Drugs (we created a list box in each of the 2 states).  We want to merge them into a cross table that shows the counts of both drugs. (See table above)


How would I go about this?  We’re relatively new to QlikView and have already dedicated countless hours to finding a solution (with little results to show for it).


Thanks so much!

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I recommend that you post a sample, or at least details of exactly how the table should work. If DrugX and DrugY are the same field on different axes, then I don't think that you can make an expression that refers to these two fields and understand the difference between them (and alternate states won't help you).

If you need some analysis like that, I would create a second Drug field which is a copy of the first. You could put these on both axes, refer to them individually in the expression, and if you then want to apply different selections to them, you could uses alternate states to achieve that.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
evan_kurowski
Specialist
Specialist

Hello Seth,

Here's a sample of a "simulated" cross-table, that is going to have a field perform a calculation against itself in an alternate state.  However, it was not done in a chart object, but rather by sculpting out text box expressions that are laboriously set within each cell in a grid fashion (which is very taxing).  It doesn't give you a full list of your values on both axes, but at least it gives you 3-floating slots on each axis to compare

It seems calculation of a field against its own alternate state is possible, but a chart expression that reaches outside the dimension to grab values against secondary dimensions that are exclusive, is still a missing component.  Except I get this idea that if the calculation can be worked out in text boxes, then it's just a matter of figuring out what the proper chart dimension would be to get the whole thing working, but...

As Jonathan pointed out... making a clone of the field and placing that cloned field as the second dimension in a cross-table can solve your calculation requirement immediately.

However, if you want to keep pursuing it via only alternate states, at least here's something to start with.

20140905_Self_referencing_pivot_table.png