Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Com,
i am searching for a peace of code in set analysis.
I have a field dateinvoice. It is a regular german date format: 26.11.2015.
Now i need a formula to display all invoices in 2016 and later for 2016 in november. .
Looks like this formula, but nothings happend.
Sum({<dateinvoice={$(=year(Today())}>costs)
Can someone help me ?
Thanks
I would suggest creating a Year field in the script using Year() function:
Year(dateinvoice) as Year
and then use this in your set analysis:
Sum({<Year = {$(=If(Month(Today()) >= 11, Year(Today() + 1), Year(Today())))}>}costs)
For all invoices in 2016:
Sum({<dateinvoice={'>=$(=yearstart(Today())) <=$(=yearend(Today()))'}>costs)
For 2016, Nov:
Sum({<dateinvoice={'>=$(=Monthstart(Today(),9)) <=$(=Monthend(Today(),9))'}>costs)
Edit: Corrected some brace errors.
I would suggest creating a Year field in the script using Year() function:
Year(dateinvoice) as Year
and then use this in your set analysis:
Sum({<Year = {$(=If(Month(Today()) >= 11, Year(Today() + 1), Year(Today())))}>}costs)
Ok Thanks for your answers.
I would use this code for a QlikSense Story, so the code shoud not be static.
That means, when today it is November the visualisation should show november. But in one month the app should display december without editing code.
In your code the visualisation will be always on November. Isnt it ?
Nope, it will change based on which month you open the app. Up until 31st Oct you will see this year's data (2016). As soon as you open the app on 1st Nov, you will start seeing 2017 data.
Many thanks it works.
CS