Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everybody,
I am trying to build a histogram of p- and chi2-values from a chi square test, that uses a dynamically calculated "Count" column to show possible associations between a pre-selectable risk faktor and a number of diseases as the diagram dimension. It works pretty much fine with static input data (see attached QVW file for an example). The individual level data is not included in the file for privacy reasons.
Is there *any* way of calculating the "Count" column dynamically - based on the selection of the individual level data? I tried using the "total" keyword and the aggr() function, but couldn't get it going. After some days of trial- and error I hope, that some of you guys can help me! !
Thanks in advance
Helmut
Here you go. I used AGGR to count the IDs at the same detailed level as the table suggests:
Chi2Test_p(
DiseasePresent,
RiskLevel,
aggr(
COUNT(DISTINCT AnonId),
DiseaseName, DiseasePresent, RiskFactor, RiskLevel)
)
cheers,
Oleg Troyansky
Come to the Masters Summit for QlikView and learn Advanced Aggregation and Advanced Set Analysis with me!
Hi Helmut,
based on the Help description of the function, you should be able to use the calculated Count, with either the TOTAL qualifier, or using AGGR(). In both cases, you should use your Chart dimension as the aggregation dimension.
I'd be happy to show you how to do it, but I need the data that you are going to count. You can either scramble the original data, or simply build a manual mock-up example with the corresponding fields.
cheers,
Oleg Troyansky
Come to the Masters Summit for QlikView and learn Advanced Aggregation and Set Analysis with me!
Hi Oleg,
thanks for the fast response. Indeed, that help entry gave me some hope about being able to do what I need, giving the hints for the usage of TOTAL and AGGR, but I couldn't find any detailed information about how nor any examples.
What you write gives me so hope!
I prepared a mock-up example for you (ChiSquareHistogram_v2.qvw). It contains
The second, defunct, chart is the one I need your help on!
Cheers
Helmut
Here you go. I used AGGR to count the IDs at the same detailed level as the table suggests:
Chi2Test_p(
DiseasePresent,
RiskLevel,
aggr(
COUNT(DISTINCT AnonId),
DiseaseName, DiseasePresent, RiskFactor, RiskLevel)
)
cheers,
Oleg Troyansky
Come to the Masters Summit for QlikView and learn Advanced Aggregation and Advanced Set Analysis with me!
Hi Oleg,
that's great. Exactly what I needed!
My mistake when trying to use the aggr() was that I was trying to find a way to make it deliver just a single column.
Thanks a bunch!!!