Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following that I need to use as a variable (shortened):
if(vMaxMonthYear='Jan16','("Jan16")',
if(vMaxMonthYear='Feb16','("Jan16"|"Feb16")',
if(vMaxMonthYear='Mar16','("Jan16"|"Feb16"|"Mar16")',
if(vMaxMonthYear='Apr16','("Jan16"|"Feb16"|"Mar16"|"Apr16")',
if(vMaxMonthYear='May16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16")',
if(vMaxMonthYear='Jun16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16")',
if(vMaxMonthYear='Jul16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16")',
if(vMaxMonthYear='Aug16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16")',
if(vMaxMonthYear='Sep16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16")',
if(vMaxMonthYear='Oct16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16")',
if(vMaxMonthYear='Nov16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16")',
if(vMaxMonthYear='Dec16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16"|"Dec16")',
',0))))))))))))
However when I view the variable it drops the ' and ' that I need. In other words I need to be able to chose 'Apr16' and it should return '("Jan16"|"Feb16"|"Mar16"|"Apr16")' and not ("Jan16"|"Feb16"|"Mar16"|"Apr16").
How do I repair the variable
chr(39) &
if(vMaxMonthYear='Jan16','("Jan16")',
if(vMaxMonthYear='Feb16','("Jan16"|"Feb16")',
if(vMaxMonthYear='Mar16','("Jan16"|"Feb16"|"Mar16")',
if(vMaxMonthYear='Apr16','("Jan16"|"Feb16"|"Mar16"|"Apr16")',
if(vMaxMonthYear='May16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16")',
if(vMaxMonthYear='Jun16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16")',
if(vMaxMonthYear='Jul16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16")',
if(vMaxMonthYear='Aug16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16")',
if(vMaxMonthYear='Sep16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16")',
if(vMaxMonthYear='Oct16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16")',
if(vMaxMonthYear='Nov16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16")',
if(vMaxMonthYear='Dec16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16"|"Dec16")',
',0))))))))))))
&chr(39)
chr(39) &
if(vMaxMonthYear='Jan16','("Jan16")',
if(vMaxMonthYear='Feb16','("Jan16"|"Feb16")',
if(vMaxMonthYear='Mar16','("Jan16"|"Feb16"|"Mar16")',
if(vMaxMonthYear='Apr16','("Jan16"|"Feb16"|"Mar16"|"Apr16")',
if(vMaxMonthYear='May16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16")',
if(vMaxMonthYear='Jun16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16")',
if(vMaxMonthYear='Jul16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16")',
if(vMaxMonthYear='Aug16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16")',
if(vMaxMonthYear='Sep16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16")',
if(vMaxMonthYear='Oct16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16")',
if(vMaxMonthYear='Nov16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16")',
if(vMaxMonthYear='Dec16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16"|"Dec16")',
',0))))))))))))
&chr(39)
Perhaps this
chr(39) & '(' &
if(vMaxMonthYear='Jan16','("Jan16")',
if(vMaxMonthYear='Feb16','("Jan16"|"Feb16")',
if(vMaxMonthYear='Mar16','("Jan16"|"Feb16"|"Mar16")',
if(vMaxMonthYear='Apr16','("Jan16"|"Feb16"|"Mar16"|"Apr16")',
if(vMaxMonthYear='May16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16")',
if(vMaxMonthYear='Jun16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16")',
if(vMaxMonthYear='Jul16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16")',
if(vMaxMonthYear='Aug16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16")',
if(vMaxMonthYear='Sep16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16")',
if(vMaxMonthYear='Oct16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16")',
if(vMaxMonthYear='Nov16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16")',
if(vMaxMonthYear='Dec16','("Jan16"|"Feb16"|"Mar16"|"Apr16"|"May16"|"Jun16"|"Jul16"|"Aug16"|"Sep16"|"Oct16"|"Nov16"|"Dec16")',
',0))))))))))))
& ')' &chr(39)
Thank you Stefan that worked absolutely perfectly
Great, if your issue is resolved, then please close this thread by marking helpful and/or correct answers: