Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlik4asif
Creator III
Creator III

Sum with respect to dimension in Pivot table

Guys i have a requirement, Data is like

   

RegionDateProductActBud
North2017-01Light1012
South2017-01Light-Fitting2022
East2017-01Engine100105
West2017-01Engine-Fitting120135
North2017-01Clutch2024
East2017-01Clutch Fitting3544

Need output like below

   

Need to consider NorthSouthEastWest
Light+Light-FittingLightSum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)
Engine+Engine-FittingEngineSum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)
Clutch+Clutch-FittingClutchSum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)Sum(Act/Bud)

Thanks in advance

6 Replies
devarasu07
Master II
Master II

Hi,

what is the issue here?

Dimension:

Product, Region

Measure:

sum(Act)/sum(Bud)

Capture.JPG

Data:

load *, pick(WildMatch(Product,'*Clutch*','*Engine*','*Light*'),'Clutch','Engine','Light') as ProductShort;

LOAD * INLINE [

  Region, Date, Product, Act, Bud

    North, 2017-01, Light, 10, 12

    South, 2017-01, Light-Fitting, 20, 22

    East, 2017-01, Engine, 100, 105

    West, 2017-01, Engine-Fitting, 120, 135

    North, 2017-01, Clutch, 20, 24

    East, 2017-01, Clutch Fitting, 35, 44

];

sumanta12
Creator II
Creator II

PIC.PNG

Calculated dim:

=IF(WILDMATCH(PRODUCT,'*CLUTCH*'),'CLUTCH',

IF(WILDMATCH(PRODUCT,'*LIGHT*'),'LIGHT',

IF(WILDMATCH(PRODUCT,'*ENGINE*'),'ENGINE',)))

Expression:

SUM(ACT/BUD)

qlik4asif
Creator III
Creator III
Author

Hi Devarasu,

Thanks for the reply

The final table which you have highlighted

in Clutch it should consider both clutch and clutch-fitting

Sum of Clutch+Clutch Fitting

Same for other products too

qlik4asif
Creator III
Creator III
Author

Hi Sumnta,

Thanks for the reply

in Clutch it should consider both clutch and clutch-fitting

Sum of Clutch+Clutch Fitting

Same for other products too

amarnath_krishn
Contributor III
Contributor III

LOAD *,
SubField(SubField(Product,'-',1),' ',1) as ProductGroup;
LOAD Region,
Date,
Product,
Act,
Bud
FROM
SourceFile;

Then use ProductGroup in your chart presentation.

sasiparupudi1
Master III
Master III

Capture.JPG