Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sabmaldun4
Contributor
Contributor

Dynamic Year to Date Calculation

Hello,

 

I am quite new to Qulikview. I am trying to create a Calculation for the Year to Date. The Goal is that I can still choose the month and Year from the filter, so the Year to date is calculated accordingly.  The fields  that I have are Month Year and Salesamount. The Salesamount is aggregated on monthly bases. 

I tried to flag the Month from starting of the year until today() with a 1 in the loadscript, but then I cannot choose the months from the filter anymore because it is fix in Set expression statement.

 

In forum I found this solution:

sum({<Year=, Month=,CalDate= {'>=$(=YearStart(Max(CalDate)))<=$(=Max(CalDate))'}>}NetCount)

 

Anyone knows how to adapt it to my case or can help me with an own solution?

Thank you!!

Labels (2)
2 Replies
Vegar
Partner
Partner

Try
SUM({<
Year={"$(=MAX(Year))"},
Month={"<=$(=MAX(Month))"},
>}
Salesamount)

You might need to change the max(Month) to maxstring(Month) depending how Month is stored.
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
sabmaldun4
Contributor
Contributor
Author

This helped me.
Thank you very much 😃