Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a dataset like this:
sales_date sales_value
12/31/2016 564
12/30/2016 487
12/29/2016 784
12/28/2016 231
12/27/2016 389
12/26/2016 474
12/25/2016 671
12/24/2016 600
... ...
I'm trying to create an expression to create a line graph, in which each line of the graph represents the sales per month of a specific year. I was planning to create such expression gradually, but I'm having trouble even with the simple stuff. What I have right now is
SUM({$<year(sales_date)={2016}>} sales_value)
But it's giving me and expression error. What is wrong with this simple statement?
(Btw, I'm finding the Qlik's syntax quite complicated. Is there some sort of expression debugger to help us find out what is wrong with our code? Thanks!)
You have to create the year field first.
Load
sales_date,
sales_value,
year(salesdate) as Year,
Month(Ssales_date) as Month
From...
and after that in the expresion:
sum({<Year={'2016'}>}sales_value)
let me know if it helps you.
Cant I use year(sales_date) instead?
No, if you use this sintaxys Qlik will show an error in expression.
Don't forge to put values in single quotes