Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I need to do Sum of dynamic variables value in expression my code as below.
=sum({$<v_product={'Product_10'},v_product={'Product_11'}>} Product_10)
How i can achive this? i have year 2010 and 2011 if im click on 2010 then ------sum('Product_10') if im selecting 2011 then sum('Product_11')
thx in adavnce
Hi,
If your going with yours then simply use
Sum($(=vProduct))
Hope it helps
Celambarasan
Hi,
Use like this on click on 2010 set variable value as Product_10 and on 2011 as Product_11
Then Use expression as
=Sum({<ProductFieldName={'$(=v_product)'}>} Sales)
Celambarasan
Thx for reply.
in my case i both variable Product_10 (2010)and as Product_11( 2011) my etl filed also like below
if(Year = '2010',ProductQty) as Product_10,
if(Year = '2011',ProductQty) as Product_11
now i need to do sum based on selecting year.
hi Srini,
Don't use product_10 or product_11 as field . use the original field ProductQty. This willl be easy.
So when u select year 2010 you will get the ProductQty for 2010.
The method you have used is making thing complex.
Deepak
Hi,
Use the expression like as
if(GetFieldSelections(Year) = vCurrent,Sum({<ProductFieldName={'$(='Product_10)'}>} Sales),
if(GetFieldSelections(Year) = vPrevious,Sum({<ProductFieldName={'$(='Product_11)'}>} Sales)), 0)
Where
vCurrent = Max(Year)
vPrevious = Max(Year) -1
Regards,
Iyyappan
thx deepak.
Hi,
If your going with yours then simply use
Sum($(=vProduct))
Hope it helps
Celambarasan
Hi Thx Cela
Im looking something like ur way.will it do sum? now im not getting sum for variables vProduct
Hi,
Ya it will do sum if you set variable value as ='Product_10'.Check with it.
Celambarasan
Hi Clea.
thx its working....