Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all, this must be a simple question for users more expertises than me ( almost all 🙂 ) .
Well, I have a graphic that show Sales by Months, I need to use a condition to set until which month the graphic shows the sales, this depend which year I have selected, the expression I used for the variables is:
If( [Year]<'2019',
'12',
'2' )
//for show 12 months or 2 months
but the grafphic don't work. for other hand if I set manually the expression like:
='12'
or
='2'
The graphic is show fine. What is the problem ? how I can correct my expression for use the condition?
thanks for advance.
Jorge
If( [Year]<2019, '12', '2' )
Single quotes denotes a string and > and < can't be used with that . So i have removed the singlequotes from 2019 and it shall work fine.
Thanks
Pradosh
Try in this way:
If( [Year]<2019, 12, 2)
The expression cannot compare a string with a number.
Thanks Ruben, but the expression "= if(..)" don't work, I set the field year as "only one value" , so isn't not a problem tha multiple value.