Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
How to write pick statement for calculated values?
For Example:
IF($(vtoggle)=1, YEAR($(=$(Date))),
IF($(vtoggle)=2, YEAR($(=$(Date))) & ' - Q' & ROUND((MONTH($(=$(Date)))+1)/3),
IF($(vtoggle)=3, TEXT(DATE($(=$(Date)),'YYYY - MM (MMM)')),
IF($(vtoggle)=4, YEAR($(=$(Date))) & ' -W' & WEEK(DATE($(=$(Date))))
))))
Here, vtoggle is var and date is the field . Iam calculating year, date, month and week.
i wrote this :
$( = pick(vtoggle, YEAR($(=$(Date))), YEAR($(=$(Date))) & ' - Q' & ROUND((MONTH($(=$(Date)))+1)/3),
TEXT(DATE($(=$(Date)),'YYYY - MM (MMM)')), YEAR($(=$(Date))) & ' -W' & WEEK(DATE($(=$(Date)))))
)
)
But iam getting some error in this expression. ERROR: "Chart is not visible due to undefined values".
why not simply this way?
pick($(vtoggle),YEAR($(=$(Date))),YEAR($(=$(Date))) & ' - Q' & ROUND((MONTH($(=$(Date)))+1)/3),TEXT(DATE($(=$(Date)),'YYYY - MM (MMM)')))
why not simply this way?
pick($(vtoggle),YEAR($(=$(Date))),YEAR($(=$(Date))) & ' - Q' & ROUND((MONTH($(=$(Date)))+1)/3),TEXT(DATE($(=$(Date)),'YYYY - MM (MMM)')))
If statement is working and all you are trying to do is to convert it into a Pick statement?
If statement is working, but iam getting performance issue . If i click buttons, it is taking long time to load
so i wanted to try with pick statement.
Thanks for the reply @asinha1991 .
If i use statement as you said, Inside year , month, week , quarter calculation which i have done is not working.
it is taking everything inside ' year', 'week' as year and week.
for example:
Pick ($(toggle), 'year', 'week')
i need output as 2015 and w2, instead its showing like year and week in words
Would you be able to share a sample showing what you have to help you better
Thank you @sunny_talwar @asinha1991
I got the solution.
This the solution : pick($(vtoggle),
YEAR($(=$(vdate))),
YEAR($(=$(vdate))) & ' - Q' & ROUND((MONTH($(=$(vdate)))+1)/3),
TEXT(DATE($(=$(vdate)),'YYYY - MM (MMM)')),
YEAR($(=$(vdate))) & ' -W' & WEEK(DATE($(=$(vdate))))
)