3 Replies Latest reply: Mar 2, 2016 4:18 PM by ilyas kuzu

# IF statement for date in expressions

i am trying this expression but it doesnt return any value;

IF ([Reporting Starts] <= date#('2016-02-27','YYYY-MM-DD'),'(Sum([Amount Spent (TRY)]))/(Sum([Video Views])))*3','(Sum([Amount Spent (TRY)]))/(Sum([Video Views]))*4.4')

i also tried;

IF ([Reporting Starts] <= 2016-02-27,'(Sum([Amount Spent (TRY)]))/(Sum([Video Views])))*3','(Sum([Amount Spent (TRY)]))/(Sum([Video Views]))*4.4')

but it didnt worked as well. could you help me please

• ###### Re: IF statement for date in expressions

hi

what are trying to achieve?

what is [Reporting Starts] ? and what is it's format ?

try to replace the condition by somethin more simple in oorder to bbe sure that the rest of the expression is working .

exemple : if (1=1,....         if (1=0,.....

then, why the expression is between quotes ?

• ###### Re: IF statement for date in expressions

hi,

i have a bar chart which shows the amount spend/video views ratio for the given days. i want multiply some days with 3 and and some days with 4.

[Report Starts] is in date format (YYYY-MM-DD)

i figured it out when i simplified the expression;

IF ([Reporting Starts] <= date#('2016-02-26','YYYY-MM-DD'), Avg([cost per view1])*3, Avg([cost per view1])*4.4)

thanks for your help

• ###### Re: IF statement for date in expressions

Try makedate(2016,02,27)