Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

3 Replies
mohamed_ahid
Partner - Specialist
Partner - Specialist

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 ?

Clever_Anjos
Employee
Employee

Try makedate(2016,02,27)

Not applicable
Author

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