Forum Discussion

hdelfis's avatar
hdelfis
Frequent Visitor
4 years ago
Solved

How to simulate a final result with only the selected values

Hi guys! 

I've trying to create a "simulation" where I select an item in a list and its sums up to my final result... 

 

Keep values:

OpportunityTypeValueWeighted Gross Margin %
O4259Commit950000.0025.00%
O4260Commit60000.0023.00%
TOTAL 1010000.0024.88%

 

Select to simulate (red):

 

OpportunityTypeValueWeighted Gross Margin %
O710Target5200000.00

23.00%

O4262Target250000.00

23.00%

 

 

Final Result:

OpportunityTypeValueWeighted Gross Margin %
O4259Commit950000.0025.00%
O4260Commit60000.0023.00%
O710Target5200000.00

23.00%

TOTAL 6210000.0023.31%

 

I've look for it across the community, but haven't found nothing similiar. 

 

Could you please help me figure it out?

  • Hi hdelfis 

    Thanks for reaching out to us.

    >> I've trying to create a "simulation" where I select an item in a list and its sums up to my final result... 

    Actually your needs can be summed up as dynamically creating tables, however this is not possible. As a workaround, you can try this, please make sure the column names in 2 tables are same.

    MTest_sum = 
    var _t1=ALLSELECTED(Table2)
    var _t2=UNION(_t1,Table1)
    return SUMx(_t2,[Value])
    MTest_Weighted Gross Margin% = 
    var _t1=ALLSELECTED(Table2)
    var _t2=UNION(_t1,Table1)
    return AVERAGEX(_t2,[Weighted Gross Margin %])
    

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi hdelfis 

    Thanks for reaching out to us.

    >> I've trying to create a "simulation" where I select an item in a list and its sums up to my final result... 

    Actually your needs can be summed up as dynamically creating tables, however this is not possible. As a workaround, you can try this, please make sure the column names in 2 tables are same.

    MTest_sum = 
    var _t1=ALLSELECTED(Table2)
    var _t2=UNION(_t1,Table1)
    return SUMx(_t2,[Value])
    MTest_Weighted Gross Margin% = 
    var _t1=ALLSELECTED(Table2)
    var _t2=UNION(_t1,Table1)
    return AVERAGEX(_t2,[Weighted Gross Margin %])
    

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.