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: 
smilingjohn
Specialist
Specialist

if

Hi All

i have this query in my edit script

if(DEPT_Code = 'COS',Date([lastSalesMatchDate] ,'YYYY-MM-DD'),Date(MonthStart(today()),'YYYY-MM-DD')) as [date]

In the above DEPT_Code   i need to include even DOT  also how do i write this 

if(DEPT_Code = 'COS',DOT,......) ?

1 Solution

Accepted Solutions
avinashelite

Try like this

if(DEPT_Code = 'COS' or DEPT_Code = 'DOT' ,Date([lastSalesMatchDate] ,'YYYY-MM-DD'),Date(MonthStart(today()),'YYYY-MM-DD')) as [date]

View solution in original post

5 Replies
Not applicable

Try this

if(match(DEPT_Code = 'COS','DOT'),Date([lastSalesMatchDate] ,'YYYY-MM-DD'),

Date(MonthStart(today()),'YYYY-MM-DD'))

Thanks,

Balakrishnan.R

avinashelite

Try like this

if(DEPT_Code = 'COS' or DEPT_Code = 'DOT' ,Date([lastSalesMatchDate] ,'YYYY-MM-DD'),Date(MonthStart(today()),'YYYY-MM-DD')) as [date]

sunny_talwar

Match doesn't need an equal sign... may be this

If(Match(DEPT_Code, 'COS', 'DOT'), Date([lastSalesMatchDate], 'YYYY-MM-DD'),

Date(MonthStart(Today()), 'YYYY-MM-DD'))

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

if(Match(DEPT_Code, 'COS', 'DOT')>0, Date([lastSalesMatchDate] ,'YYYY-MM-DD'),Date(MonthStart(today()),'YYYY-MM-DD')) as [date]

Help users find answers! Don't forget to mark a solution that worked for you!
Not applicable

Yes, apologies.

Match does not need an equal sign.