Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, i'm getting trouble in defining this set.
I would like to set as condition that Surgery Date is between vStartDate (variable) and vStartDate + 1 year.
How this can be done ?
Thank you!
I TRIED AS FOLLOW
=if(Match([SalesRepException],'I22') AND SurgeryDate>=($(vStartI22)) AND SurgeryDate<=($(vStartI22)+365),'30% PLAN',
if(Match([SalesRepException],'I23') AND SurgeryDate>=($(vStartI23)) AND SurgeryDate<=($(vStartI23)+365),'30% PLAN',
if(Match(SalesRep,'HORIZON'),Territory_Description,if(Match(ShipTo,'123776'),'MATERDOMINI',
if(isnull([Percentage]),if(isnull(PercentageProductLine), ' ', Product_Line_Description),Territory_Description)))
))
COULD IT MAKE SENSE ?
maybe something like
=If(Match([SalesRepException],'I22','I23') AND SurgeryDate >= vStartDate AND SurgeryDate <= AddYears(vStartDate,1), yourtrueexpression, yourfalseexpression)
hope this helps
regards
Marco
As you noticed, BETWEEN is not in the Qlik syntax. You could do a "less than" and a "larger than" comparison to solve it.
SurgeryDate >= '$(vStartDate)' AND SurgeryDate <= addyears('$(vStartDate)')
How does your if statement look like? is it an measure like IF(<logic>, <statement>) with no else statement? ifIf so, then you could consider if it is better to create an SET statement instead of using an IF.