3 Replies Latest reply: Sep 23, 2015 9:23 AM by Gysbert Wassenaar

# Aggregating Dimension

Hello everyone.

There are five stores with their sales, and everyone of these is identified by a code. Two of these stores changed their codes two times. In Qlik I have the sum of sales for everyone of this five stores depending on their codes: this means that if the store changed codes three times, in Qlik I see the sum of sales for each of these codes (note that the store is always the same). So, I visualize nine stores.

My target is to visualize only the five stores, and get the aggregate of sales for the two stores that changed code.

Here's an example:

Store     Sales

A          100

B          90

C          80

D          70
E          60

F          50

G          40

H          30

I          20

Store A, before having the code 'A', had the code 'F' and 'G'. F made sales for 50, G made sales for 40.

Store B, before having the code 'B', had the code 'H' and 'I'. H made sales for 30, 'I made sales for 20.

The final result is:

Store     Sales

A          190

B          140

C          80

D          70
E          60

How can I do this?

• ###### Re: Aggregating Dimension

Create a table that maps store names to the original store

SalesMap:

OriginalStore, Store

A, A

A, F

A, G

B, B

B, H

B, I

C, C

D, D

E, E

];

Sales:

LOAD Store, Sales From ... ;

Then use the field OriginalStore as dimension and sum(Sales) as expression in a straight table object.

• ###### Re: Aggregating Dimension

Thanks Gysbert,

But I have another problem: How I do mapping?

• ###### Re: Aggregating Dimension

I have no idea. If you don't keep track of which stores get renamed to what then what you want is not possible. That information has to be recorded somewhere. If the information does not exist then Qlikview can't use it.