Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, Everyone
I try to use this equation to calculate the measure, using input variable .
Count({<[EventDTS] = {"=[EventDTS]>=$(Target_Period_Start) and [EventDTS] <= $(Target_Period_end)"},Source = {'OR'}>} distinct ID)
but when i change the variable value ($(Target_Period_end)), the measure didn't updated according to the variable
is there any way to refresh or make the measure recalculate according to updated value ?
Hello,
I think there is an error in your set analysis :
instead of
Count({<[EventDTS] = {"=[EventDTS]>=$(Target_Period_Start) and [EventDTS] <= $(Target_Period_end)"},Source = {'OR'}>} distinct ID)
You can try something like that (change the date format according to those in your application)
Count({<[EventDTS]= {">=$(=date(date#('$(Target_Period_Start)','DD/MM/YYYY')))<=$(=date(date#('$(Target_Period_end)','DD/MM/YYYY')))"},Source = {'OR'}>} distinct ID)
You can see in the editor your expression and then see how Qlik interpret your set analysis
Regards,
Thanks for your support
I tried your suggestion but didn't give any result with me. as in attachement
as you see the variable didn't extracted in the equation.
while when I use my equation it extracted and give initial result, but when change the input variable didn't recalculated according to the new input.
example . when the initial target_period = 'Year' , it caculate the count of the past year and give 10000, then it should when change target_period to 'Month' , it should recalculate the count to give the count from the start of the year to the past month only and give result 6000. but the measure didn't changed and still give 10000.
Note: if i use KPI card and add second KPIs as $(target_peroid_start) , it work normal and recalculate the measure in Frist KPI
Sometimes you have to do refresh manuallyCtrl + Shift
and R
Ah ok, I see, in my example, I consider that Target_Period_Start is a date that you enter manually.
Can you try with $(=Target_Period_Start) ?
It should calculate the value of your variable and show iy in the expression evaluator.
thanks for your help
I used other equation that give correct result with less time loading
count (distinct( if(EventDTS>=$(Target_Period_Start), if(EventDTS <= $(Target_Period_end),if(Source='OR', ID)))))