Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm trying to show only data from 2015. Here is the expression I wrote that isn't working:
Sum({$<MONTH = {'2015*'}>} POPULATION)
I've tried different configurations of this, but everyone returns a blank table.
MONTH field in my input table is formatted as dd.mm.yyyy
In my table, I selected MonthYear
I've tried putting the asterisk before 2015 and it doesn't work. I've also tried showing only march 01, by writing {'01.03*'} and that doesn't work, either.
= sum({<MONTH= {">=$(=Date#('01.01.2015','dd.mm.yyyy')) <=$(=Date#('31.12.2015','dd.mm.yyyy'))"}> } POPULATION)
Okay, I got his to work. I just needed to use the double quotes and put the asterisk BEFORE the year. Anyway, can you explain how this works, and why some of these expressions work and some don't? I've included the data below.
Sum({<MONTH= {">=$(=Date#('01.01.2016','dd.mm.yyyy')) "}> } POPULATION)
Works: Gives me everything great or equal to 2016.
Sum({<MONTH= {"=$(=Date#('01.01.2016','dd.mm.yyyy')) "}> } POPULATION)
Does not work: I was expecting to get everything equal to Jan-1, 2016, instead I get an empty table.
Sum({<MONTH= {">=$(=Date#('*.2016','dd.mm.yyyy')) "}> } POPULATION)
Does not work: I was expecting everything greater and equal to 2016 using the wildcard. Instead I got an empty table.
This works with the asterisk in front:
Sum({$<MONTH = {"*2015"}>} POPULATION)
Maye be :
= sum({<MONTH= {">=$(=Date#('01.01.2015','dd.mm.yyyy'))"}> } POPULATION)
you can also change in load Script :
SET DateFormat='DD.MM.YYYY';
Thanks for replying.
Qlik accepts that as an acceptable expression, but it doesn't actually filter anything. It still shows the full date range, including data from 2016, 2017, 2018, etc.
= sum({<MONTH= {">=$(=Date#('01.01.2015','dd.mm.yyyy')) <=$(=Date#('31.12.2015','dd.mm.yyyy'))"}> } POPULATION)
Ahhh, okay. I wasn't reading the ">" as a greater than symbol. I thought it was a different version of the angle brackets that Qlik uses in its expressions. Also, my data starts at 2015, so I wasn't seeing any change.
Thanks. I may have a follow up question about the syntax.
You should adjust your modifier to double quotes like this:
Sum({$<MONTH = {"2015*"}>} POPULATION)
That still doesn't work.
The above poster's solution works. I'm assuming it has something to do with MONTH being formatted as a date and not a string or numberic.
can you share a sample data if @Vegar 's solution not working for you
Okay, I got his to work. I just needed to use the double quotes and put the asterisk BEFORE the year. Anyway, can you explain how this works, and why some of these expressions work and some don't? I've included the data below.
Sum({<MONTH= {">=$(=Date#('01.01.2016','dd.mm.yyyy')) "}> } POPULATION)
Works: Gives me everything great or equal to 2016.
Sum({<MONTH= {"=$(=Date#('01.01.2016','dd.mm.yyyy')) "}> } POPULATION)
Does not work: I was expecting to get everything equal to Jan-1, 2016, instead I get an empty table.
Sum({<MONTH= {">=$(=Date#('*.2016','dd.mm.yyyy')) "}> } POPULATION)
Does not work: I was expecting everything greater and equal to 2016 using the wildcard. Instead I got an empty table.
This works with the asterisk in front:
Sum({$<MONTH = {"*2015"}>} POPULATION)