Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if statement work only if a value is selected

if(valmaternité=1,if ([Code d'entreprise]='12',interval(num(Time#('02:00','hh:mm')),'hh:mm'),interval(num(Time#('01:00','hh:mm')),'hh:mm')))

this expression work only if i selected 1 for valmaternité

any help please

12 Replies
Not applicable
Author

i want valmaternité takes 1 for a period of one year begining from mindate. that's all

jpenuliar
Partner - Specialist III
Partner - Specialist III

looks to me that your code is doing the job on that:

if(IsNull(mindate),2,if(Date>=mindate and Date<=AddYears(mindate,1),1,0)) as valmaternité

up to you to validate valmaternité values.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Does each row of your chart point to more than 1 valmaternité value? If so, you'll need to use an aggregation like max(valmaternité) to tell your expression which one to use.


-Rob