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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

selection "date" between

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!

qlikviewaf_0-1631887907977.png

 

Labels (1)
3 Replies
qlikviewaf
Creator
Creator
Author

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 ?

MarcoWedel
MVP
MVP

maybe something like 

=If(Match([SalesRepException],'I22','I23') AND SurgeryDate >= vStartDate AND SurgeryDate <= AddYears(vStartDate,1), yourtrueexpression, yourfalseexpression)


hope this helps
regards
Marco

Vegar
MVP
MVP

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.