Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I Group Dimension results?

Hello, I am very new to Qlikview user and am wondering if it's possible to create groups for a dimension?  My chart type could be either a Pivot Table or Straight Table.

So, for example,  I am pulling the Dimensions of Geography and ABBR (which are types of coverages) to get the below results,  where my calculated expressions will be sums of Premium, Fees, Losses.

Geography     ABBR      Premium      Fees      Losses

ARIZONA        UMBI            $xx          $xx        $xx

ARIZONA        CC                $xx          $xx        $xx

ARIZONA        BI

ARIZONA        TOW

ARIZONA         PD

ARIZONA         RENT

ILLINOIS          UMBI

ILLINOIS          CC

ILLINOIS          BI

ILLINOIS          TOW

ILLINOIS          PD

ILLINOIS          RENT

I would like to create a new dimension of 'Liability' which groups BI and PD for Arizona and groups BI, PD and UMBI for Illinois. And along those same lines, a new category of 'Other' which groups TOW and RENT for both Arizona and Illinois. Is that possible?

Thanks in advance for the help!

1 Solution

Accepted Solutions
chiru_thota
Specialist
Specialist

you can do it in two ways

(1) have a calculated dimension with if statement

=if(match(Geography,'val1','val2','valn'),'Groupname1',

if(match(Geography,'val1','val2','valn'),'Groupname2',Geography))

(2) Inline table look up with grouping (one columns with Geography and other one Liability)

Thanks,

Chiru

View solution in original post

4 Replies
Nicole-Smith

You can do this where you're originally loading in your data.  Your load statement should already look something like the following, so you'll just need to add the part in bold:

LOAD Geography, ABBR, Premium, Fees, Losses, if((match(ABBR, 'BI', 'PD') and Geography = 'ARIZONA') or (match(ABBR, 'BI', 'PD', 'UMBI') and Geography = 'ILLINOIS'), 'Liability', 'Others') as Liability

FROM Somewhere;

Not applicable
Author

I don't have approval to change the load statement as others are using the same data set. Is there a work around to that if I can't change it?

chiru_thota
Specialist
Specialist

you can do it in two ways

(1) have a calculated dimension with if statement

=if(match(Geography,'val1','val2','valn'),'Groupname1',

if(match(Geography,'val1','val2','valn'),'Groupname2',Geography))

(2) Inline table look up with grouping (one columns with Geography and other one Liability)

Thanks,

Chiru

Not applicable
Author

Thanks all. I can't change the load statement so the If statement worked for what I needed. Thanks!