Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Maciej29
Contributor III
Contributor III

How to convert this excel formula into qlik sense one in set expression

Have an issue with below formula. What should be done to make it work in qlik sense

 

=IF(B2<=30,"0-30 days",IF(AND(B2>30,B2<=90),"31-90 days",IF((AND(B2>90,B2<=200)),"91-200 days",IF(B2>200,"more than 201 days","verify"))))

B2=Leadtime

 

Thanks in advance

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Perhaps this

=IF(Leadtime<=30,'0-30 days',
IF(Leadtime>30 and Leadtime<=90,'31-90 days',
IF(Leadtime>90 and Leadtime<=200,'91-200 days',
IF(Leadtime>200,'more than 201 days','verify'))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

Perhaps this

=IF(Leadtime<=30,'0-30 days',
IF(Leadtime>30 and Leadtime<=90,'31-90 days',
IF(Leadtime>90 and Leadtime<=200,'91-200 days',
IF(Leadtime>200,'more than 201 days','verify'))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Maciej29
Contributor III
Contributor III
Author

Thank you! , I thought it's harder to get it.

 

p_verkooijen
Partner - Specialist
Partner - Specialist

Not sure what dimensions you are using, or how you calculate the Leadtime

If Leadtime is a precalculated field in your datamodel use the expression below in your script ( expression AS LeadtimeLabel)

 

=IF(SUM(Leadtime)='','verify',IF(SUM(Leadtime)<=30,'0-30 days',IF(SUM(Leadtime)<=90,'31-90 days',IF(SUM(Leadtime)=200,'91-200 days','more than 201 days'))))