3 Replies Latest reply: Jun 18, 2014 1:31 PM by Gysbert Wassenaar

# How to make a calculated dimension the way I want?

Hi, QV community

I need to some help to make a calculated dimension.

I have an example for you guys to see.

I will talk about the example because you understand better if you look at it.

First take a look at the example before read my explanation.

One Job Number (AARS10) which is the same number as the console Job has information about the cost and Container Type.

The other Job Numbers (AARS11 and AARS12) have information about the revenues and nothing about the container type as you can see in the data below

I need the to get the same Container Types value in all my jobs. So when I filter Container Type "40HC" I will get jobs number AARS10, AARS11, AARS12 and IMMS10.

I tried to use this formula below but I did not work the way I want it but it is close.

=aggr(MaxString(TOTAL <[Console Job]> [Container Type]),[Console Job],[Job number])

It worked but created a problem for Console Job IMMS10 becuase it has many different Container Types.

How can I do make an formula in the calculated dimension that shows the way I want.

You can see how I want it in the Calculated dimension below.

Any ideas?

 Console Job Job number Revenue Cost Container Container Type Calculated dimension AARS10 AARS10 0 3500 3 40HC 40HC AARS10 AARS11 1500 0 0 - 40HC AARS10 AARS12 2500 0 0 - 40HC IMMS10 IMMS10 5000 3000 1 40HC 40HC IMMS10 IMMS10 5000 3000 1 20DC 20DC IMMS10 IMMS10 5000 3000 1 40DC 40DC
• ###### Re: How to make a calculated dimension the way I want?

Try =aggr(if([Container Type]<>'-'   ,[Container Type]  ,MaxString(total <[Console Job]> [Container Type])), [Console Job], [Job number],[Container Type])

• ###### Re: How to make a calculated dimension the way I want?

thanks for the respond Gysbert

what should I do if the database looked like this below.

The only thing I changed is the container type has no value for Job number AARS11 and AARS12.

What should I change if there is no value just nothing

 Console Job Job number Revenue Cost Container ContainerType Calculated dimension AARS10 AARS10 0 3500 3 40HC 40HC AARS10 AARS11 1500 0 0 40HC AARS10 AARS12 2500 0 0 40HC IMMS10 IMMS10 5000 3000 1 40HC 40HC IMMS10 IMMS10 5000 3000 1 20DC 20DC IMMS10 IMMS10 5000 3000 1 40DC 40DC
• ###### Re: How to make a calculated dimension the way I want?

Try =aggr(if(len(trim([Container Type]))>0', [Container Type], MaxString(total <[Console Job]> [Container Type])), [Console Job], [Job number],[Container Type])