Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to read the selection of the user in the chart cycle(day,week,Month)
I have columns flags i want to do the sum of a parameter X where flag= 1
I have flag_ endweek, flag endmonth, flag end year....
I used this variable
v_set_flags=if(getcurrentfield(Time_Scale)='CAL.YEARWEEKNUM','flag_week={"1"}',
if(getcurrentfield(Time_Scale)='CAL.YEAR','Flag_yearEnd={"1"}',
if(getcurrentfield(Time_Scale)='CAL.QUARTER','Flag_QuarterEnd={"1"}',
if(getcurrentfield(Time_Scale)='CAL.YEARMONTH','Flag_Month={"1"}', 'CAL.K_DATE*={"*"}'
))))
Then i defined a set analysis for the chart:
sum({<"$( v_set_flags)"> } ParamaterX)
Mu purpose is for example user select Week-----> Do the sum of parameterX where flagweek=1
if selction Month---> Do sum of parametrX where flagMonth=1.........
It gives me very high values and wrong calculation can you please help me to solve this issue ?
Hi
Remove the double quotes in ur set analysis & try it.
sum({<$( v_set_flags)> } ParamaterX)
And also, hope your variable has equal sign like below
I tryed that aleady it's not working the calculation always wrong
Yes ia have equal sigh
Hi,
Its working fine for me.
Can you send the sample file to debug in detail?
Hello,
here you have an example with one parameter, and the data is like that shape
I have column flags and i want to calculate only where flags=1 depending on the cycle selection(Week,Month...)
you have the variable and the code used, my problem is that it works but results are false
Hi
PFA
Based on ur sample, its "Time" .
Hello,
Actually yes it works but in stead of taking only the values for the end of the week for example it takes the sum of all the values of the previous week until this week.
Which is False i want to calculate the sum of the end of each week only for this week.
it takes all the flags_week=1 and sum them
since i want to take for example for week 31 , the sum of values at the end of this week only flags=1 for this periode not to sum with the pervious periode