Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension

Hi everyone,

I am stuck, and hoping that someone can point me to a right direction here.

I would like to create a dimension which compares 2 columns (M1 vs M2) whose members are GT and LE. If M1 is greater than M2, then sum(M3) on GT, else sum(M4) on LE.

My problem is that my underlying dataset contains YearMonth, but the desired dimension and calculation depend on (entired) current selection, and creating a calcuated dimension in the load script will not get what I need.

Any help or suggestion will be much appreciated. Thank you.

DATASET:

(see attached)

Desired Result:

Dim_01M1 vs M2Sum
AAGT (M1 >M2)sum(M3)
AALE (M1<=M2)sum(M4)
BBGT (M1 >M2)sum(M3)
BBLE (M1<=M2)sum(M4)
CCGT (M1 >M2)sum(M3)
CCLE (M1<=M2)sum(M4)
DDGT (M1 >M2)sum(M3)
DDLE (M1<=M2)sum(M4)
EEGT (M1 >M2)sum(M3)
EELE (M1<=M2)sum(M4)
1 Solution

Accepted Solutions
Kushal_Chawda

see the attached one

View solution in original post

12 Replies
Kushal_Chawda

see the attached one.

Kushal_Chawda

see the attached one

Not applicable
Author

Hi Kush,

thank you for your help and response.

I didn't state the requirement quite clearly (my apology). The calculated dimension needs to be based on sum(M1) vs sum(M2) and time period.

Dim_01M1 vs M2Sum
AAGT (sum(M1) > sum(M2))sum(M3)
AALE (sum(M1) <= sum(M2))sum(M4)
BBGT (sum(M1) > sum(M2))sum(M3)
BBLE (sum(M1) <= sum(M2))sum(M4)
CCGT (sum(M1) > sum(M2))sum(M3)
CCLE (sum(M1) <= sum(M2))sum(M4)
DDGT (sum(M1) > sum(M2))sum(M3)
DDLE (sum(M1) <= sum(M2))sum(M4)
EEGT (sum(M1) > sum(M2))sum(M3)
EELE (sum(M1) <= sum(M2))sum(M4)

As an example, if ID=3 is selected, I would like to display below. Sorry for the confusion and I do appreciate the help. Thank you,.

Dim_01M1 vs M2Sum
BBGT (sum(M1) > sum(M2))0
BBLE (sum(M1) <= sum(M2))98
DDLE (sum(M1) <= sum(M2))63
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this as expression

     sum(aggr(if(sum(M1)>Sum(M2),Sum(M3),Sum(M4)),Dim_01))

     and dimension as Dim_01

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

thank you for the suggestion. However, I would like to have 2 dimensions in my desired table/report.

  1. Dim_01
  2. Versus (i.e. M1 vs M2)

The Versus dimension will allow me and users to see calculation in different buckets (there will alo be more metrics in the report). Unfortunately, this is one of the requirements and I am not so sure how to calculate my metrics when Versus dimension is not fixed (hope this makes sense).

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You need to come up with the business logic to derive the Versus field.

Regards,

Kaushik Solanki    

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

the logic is if the sum of M1 is greater than sum of M2, then ">", else "<=".

The sum of M1 and M2 are calculated based on current selection, and I am having trouble create a flag or a calculated dimension which can indicate whether or not sum of M1 is greater M2.

Kushal_Chawda

See the attched one

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear

     I am not talking about that logic.

     I am talking about how to define the M1 vs M2 as dimension.

     I am sorry but i am not clear.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!