Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Partner
Partner

Sum between date in table

Good morning all,

Can someone please help me with some syntax?

I have two fields named StartDate and EndDate and I need to sum the total amount of Value that falls into them and the selection in dates.

I try this

Sum( {$<Date = {“>=$(=Only(StartDate))<=$(=Only(EndDate))”} >} InvoiceAmount)

But this doesn't work in my table.

dim 1startdateenddate

Sum( {$<Date = {“>=$(=Only(StartDate))<=$(=Only(EndDate))”} >} InvoiceAmount)


Only(Startdate)
A117/01/201331/12/2013-17/01/2013
A218/02/201331/12/2014-18/02/2013






I need to select the year, for example 2013, but i want that my expression show the amount starting at 17/01/13 for first row and at 18/02/2013 for second row.

Can anyone help me, please?

Bye

2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Sum between date in table

You'll have to use an if statement here. Set analysis calculates one set for the entire chart, not a set per row. Try sum(if(Date>=StartDate and Date<=EndDate, InvoiceAmount))


talk is cheap, supply exceeds demand
Highlighted
er_mohit
Honored Contributor II

Re: Sum between date in table

try this way

Sum( {$<Date = {“>=$(=date(StartDate))<=$(=Date(EndDate))”} >} InvoiceAmount)