Skip to content
mapping setup based...
 
Notifications
Clear all

mapping setup based on criteria and aggregation

2 Posts
2 Users
0 Reactions
1,749 Views
Posts: 3
Customer
Topic starter
(@6fewdoagajboxbto9hgrxcyfvyo2)
Active Member
Joined: 3 years ago

Hi, i was needing help with setting up some mapping based on criteria and then using that mapping to carry out some addition/summing between these items. Below is what i am trying to achieve.

I have 2 indexes - "All" & "Months" and a variable - "Current_Vals" (indexed by "All" and "Months") like so:

Index: All Index: Months   Var: Current_Vals      
        1-Jan-22 1-Feb-22 1-Mar-22
Prod_A 1-Jan-22   Prod_A 0 1 1
Prod_A_Overseas 1-Feb-22   Prod_A_Overseas 0 2 2
Prod_B 1-Mar-22   Prod_B 1 2 3
Prod_B_Overseas     Prod_B_Overseas 0 0 0
Prod_C     Prod_C 6 8 10
Prod_C_Overseas     Prod_C_Overseas 2 1 0
Prod_D     Prod_D 5 5 5
Prod_D_Overseas     Prod_D_Overseas 2 2 0

With the mapping, i want to carry out a summation on the "Current_Vals" like so:

  • Prod_A = Prod_A + Prod_A_Overseas
  • Prod_B = Prod_B + Prod_B_Overseas
  • etc

but not this:

  • Prod_A_Overseas = Prod_A + Prod_A_Overseas
  • Prod_B_Overseas = Prod_B + Prod_B_Overseas

So the totalling results like so (interim step):

Var: Interim_Step      
  1-Jan-22 1-Feb-22 1-Mar-22
Prod_A 0 3 3
Prod_A_Overseas 0 2 2
Prod_B 1 2 3
Prod_B_Overseas 0 0 0
Prod_C 8 9 10
Prod_C_Overseas 2 1 0
Prod_D 7 7 5
Prod_D_Overseas 2 2 0

but my final output is this:

Var: Final Output      
  1-Jan-22 1-Feb-22 1-Mar-22
Prod_A 0 3 3
Prod_B 1 2 3
Prod_C 8 9 10
Prod_D 7 7 5

The indexing here can/is different (but a subset of "All").

Any help is greatly appreciated. Thanks

 

 

1 Reply
Posts: 7
Customer
(@jessiesandoval)
Active Member
Joined: 4 years ago

This looks like you have three dimensions, i.e., 

 

Index Product := ['Prod_A', 'Prod_B', 'Prod_C', 'Prod_d']

Index IsOverseas := ['Not Overseas', 'Overseas']

Index Month := 1-Jan-2022 .. 1-Mar-2022

If you organize your data that way, then you can do 

Sum( Current_Vals, IsOverseas )

for your Final_output corresponding to

  • Prod_A = Prod_A + Prod_A_Overseas
  • Prod_B = Prod_B + Prod_B_Overseas
  • etc

 

Reply
Share:

Download Free Analytica


    We hate spam as much as you. We won't share your email with third parties.
    The free edition of Analytica includes these key Analytica features:
    Free Analytica has no time limit. The only constraint is it won’t let you create more than 100 variables or other objects. But your model can be quite substantial since each variable can be a multidimensional array. It also lets you explore, change inputs, and run existing models of any size (excluding features unique to the Enterprise or Optimizer editions).

    Download the free edition of Analytica

    The free edition of Analytica includes these key Analytica features: 

    Free Analytica has no time limit. The only constraint is it won’t let you create more than 100 variables or other objects. But your model can be quite substantial since each variable can be a multidimensional array.  It also lets you explore, change inputs, and run existing models of any size (excluding features unique to the Enterprise or Optimizer editions).

    Analytica runs on any Windows computer, or on a Macintosh using Parallels or VMWare.


      Analytica Cubes Pattern