Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi QVs,
I was trying to show only the values of a line chart which follow a condition, for example those that are in 2014. I edit the expression in show value with: =if(year(datefield)='2014', 1,0) but it doesn't work.
I found some discussions about it but i couldn't get a solution. Any idea?
Thanks for helping.
Marc.
Perhaps your date field is not properly formatted, use parsing fucntion date#() like:
=year(Date#(datefield, 'MMM YYYY'))=2014
use like
If(Year[Datefield] = '2014',Expression,0)
Expression is like - sum(Sales)
Field format is fine. Anyway i also tried with date# and date function, but no result.
Basically that's what I typed. Changing the 1 by another expression doesnt give any result neither.
Could you post a sample qvw?
PFA.
Marc.
The simple solution to your example file is:
=Count(IF(Year(FechaEncuesta)='2014',FechaEncuesta,NULL()))
I would recommend Set Analysis though.
Kind regards
Niklas
Niklas, the issue is not in the expression itself but in the 'show value' expression, explained in the initial post.
Thanks anyway.
Well, put my formula in the Show Value box.
See attached example.
Kind regards
Niklas