Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Working with dates and selections

Hi!
I have to sum revenues from the 1st of January, 2015 to a day that an user can select.

For example, if I select the 1st of July, 2015 Qlik returns the sum of revenues from the 1st of January to the 1st of July.

How can I do this?

Thanks!

4 Replies

Re: Working with dates and selections

use getfieldselections(myField) to read the selected data

Re: Working with dates and selections

Hi

Try like this

= Sum({<Date={">=$(=date(YearStart(Max(Date))))<=$(=date(max(Date)))"}, Month=, Year=>} Revenue)

Re: Working with dates and selections

See this discussion: How to select dates for the current month

Instead of MonthStart you would use YearStart.


talk is cheap, supply exceeds demand

Re: Working with dates and selections

May be this:

Sum({<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'yourDateFormat') & '<=' & Date(Max(Date), 'yourDateFormat'))"}>}Revenue)

HTH

Best,

Sunny

Community Browser