Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Edit show value in expression

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.screen.png

I found some discussions about it but i couldn't get a solution. Any idea?

Thanks for helping.

Marc.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Or, even simpler:

=Max(Year(FechaEncuesta)=2014)

View solution in original post

12 Replies
tresesco
MVP
MVP

Perhaps your date field is not properly formatted, use parsing fucntion date#() like:

=year(Date#(datefield, 'MMM YYYY'))=2014

Anonymous
Not applicable
Author

use like

If(Year[Datefield] = '2014',Expression,0)

Expression is like - sum(Sales)

Anonymous
Not applicable
Author

Field format is fine. Anyway i also tried with date# and date function, but no result.

Anonymous
Not applicable
Author

Basically that's what I typed. Changing the 1 by another expression doesnt give any result neither.

tresesco
MVP
MVP

Could you post a sample qvw?

Anonymous
Not applicable
Author

PFA.

Marc.

Anonymous
Not applicable
Author

The simple solution to your example file is:

=Count(IF(Year(FechaEncuesta)='2014',FechaEncuesta,NULL()))

I would recommend Set Analysis though.

Kind regards

Niklas

Anonymous
Not applicable
Author

Niklas, the issue is not in the expression itself but in the 'show value' expression, explained in the initial post.

Thanks anyway.

Anonymous
Not applicable
Author

Well, put my formula in the Show Value box.

See attached example.

Kind regards

Niklas