Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

inescastelhano
Contributor

Aggr function problem

Hi guys,

I am having trouble with the following expression, because it is returning zero and it shouldn't:

=sum(aggr( (

(sum( { < myYear=,myMonth=,myDay=, [End Date]=$(=vDataSel_min),[myDate]=$(=vDateSel) > } [End Date] ) )

-

(min( {$} TOTAL

([myDate])))),[ID]))

My idea is to subtract the minimum of the selected date to the EndDate for each ID. Each ID has its own EndDate.

I have already the following similar expression and it is working fine:

=sum(aggr((

max({$} TOTAL

([myDate])+1)

)

- (sum({<myYear=,myMonth=,myDay=, [myDate]=$(=vDateSel),[End Date]=$(=vDataSel_max)>}

([myDate]))),[ID]))

I don't understand why it is working for the second one and it is not working for the first one. There are no errors in the defined variables, I am using all of them in other objects.

Thanks in advance,

Inês

Tags (1)
Community Browser