Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Contributor III

Understanding TTest_sig with Pivot Table

Hi Expert,

I am trying to create a pivot table that has dimensions as Sector, Zone and station as hierarchy.

I am using the TTest_sig() function to calculate significance value.

However, it does not work for me unless I create 3 different data sets one for Sector, one for Zone and one for Station.

For example:

Original Data Set:



DateYear monthSectorZoneStationValue
1/01/20172017 JanSector1Zone1Station115
3/01/20172017 JanSector1Zone1Station329
5/01/20172017 JanSector1Zone1Station559
7/01/20172017 JanSector1Zone1Station736
9/01/20172017 JanSector1Zone1Station955
2/01/20172017 JanSector1Zone2Station292
4/01/20172017 JanSector1Zone2Station458
6/01/20172017 JanSector1Zone2Station646
8/01/20172017 JanSector1Zone2Station873
10/01/20172017 JanSector1Zone2Station1061
1/02/20172018 JanSector1Zone1Station179
2/02/20172018 JanSector1Zone1Station314
3/02/20172018 JanSector1Zone1Station539
4/02/20172018 JanSector1Zone1Station727
5/02/20172018 JanSector1Zone1Station917
6/02/20172018 JanSector1Zone2Station254
7/02/20172018 JanSector1Zone2Station416
8/02/20172018 JanSector1Zone2Station678
9/02/20172018 JanSector1Zone2Station860
10/02/20172018 JanSector1Zone2Station1054

Will the TTest_sig work currectly only when I have three different data sets like below?

    Group by Sector data set

Sector.DateYear MonthSectorValue
1/01/20172017 JanSector1522
2/01/20172017 JanSector1434
1/01/20182018 JanSector1521
2/01/20182018 JanSector1447

     Group by Zonedata set

Zone.DateZone.Year MonthZone.ZoneZone.Value
1/01/20172017 JanZone1263
1/01/20172017 JanZone2259
2/01/20172017 JanZone1240
2/01/20172017 JanZone2194
1/01/20182018 JanZone1267
1/01/20182018 JanZone2254
2/01/20182018 JanZone1234
2/01/20182018 JanZone2213

I get different results when calculating the TTest for the same data set but grouped differently. Please see the attache sample file.

Does this mean I have to create different set of data (as grouped above) to get correct results?



2 Replies
Contributor III

Re: Understanding TTest_sig with Pivot Table

Hi There,

Can anyone please help me with my request ?

Thanks in advance.



Contributor III

Re: Understanding TTest_sig with Pivot Table

Hi Sunny,

Can you please help me with the above request?


I tried to use the SUM() in the function but it does not work.

TTest_Sig([OriginalDataSet.Year Month],[OriginalDataSet.Value])