# New to QlikView

Discussion board where members can get started with QlikView.

Contributor II

## Aggregation on Calculated Dimension

Hi all,

I've a calculated dimension 'FinalSegment' and I need to create a Cost measure which uses aggregation on FinalSegment. I tried the following and it didn't work.

I've created variable vFinalSegment :  if(len(trim(Segment))=0,Segment_2,Segment)

Cost =

But, this measure  returns 0.

May I know how to do this?

Thanks!

Tags (4)
6 Replies
Honored Contributor II

## Re: Aggregation on Calculated Dimension

hi,

try like this

Method 1:

create calculated dimension

aggr(sum( {\$<Segment={"=len(trim(Segment))<=0"}>}cost),Segment_2,Segment)

method 2:

dimension:

Segment

Segment_2

Measure:

sum( {\$<Segment={"=len(trim(Segment))<=0"}>}cost)

if still not working, try to share mock data with expected output in excel format

Thanks,

Deva

Highlighted

## Re: Aggregation on Calculated Dimension

Can you replace it to first place

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
MVP

## Re: Aggregation on Calculated Dimension

Are you evaluating your variable rowwise or chartwise? For chart wise, may be try one of the two:

Or

or if this is row wise, may be this

Contributor II

## Re: Aggregation on Calculated Dimension

Hi Sunny,

I'm, doing it chart wise; I've tried the expressions you've suggested but  they are returning 0

Any clue what could be going wrong?

MVP

## Re: Aggregation on Calculated Dimension

Would you be able to share a sample to check this out?

Contributor II