Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a chart expression using set analysis, part of which is as follows:
Phase={'$(vPhase)'}
The variable 'vPhase' is changed when the user selects a button - Early, Late, All
The problem is, whilst 'Early' and 'Late' are values in field 'Phase' (so expression works fine for those two), 'All' is not a value in 'Phase' - it's just all values!
I was thinking I would replace the above part of my set analysis to include an if statement, but can't get it working. So far, I have:
Phase={'$(=IF(vPhase='Early','Early',IF(vPhase='Late','Late',IF(vPhase='All','???')))'}
But, I'm not sure if I'm declaring my variables correctly here - never sure when they should/shouldn't be bracketed - and I also don't know what I want to say for the 'then' part of my 'If' statement for 'All'. Can I say IF(vPhase='All','Early' and 'Late) ?
How about this:
Phase={"$(=Pick(Match(vPhase, 'Early', 'Late', 'All'), 'Early', 'Late', '*'))"}
May be as below:
Phase={'$(=IF(vPhase='Early','Early',IF(vPhase='Late','Late',IF(vPhase='All','*')))'}
Hi Jessica,
Try this:
If(vPhase = 'All',
Use this set analysis: Phase={'*'},
Phase={'$(vPhase)'}
)
Regards!!
Hi,
Unfortunately that doesn't seem to work - I just get the red 'error' line under that part.
Could you share a sample of your application
Hi Manuel,
I don't understand how that would fit into my overall expression.
In its entirety it reads:
=IF (Name='$(vName)', COUNT ({1<Overall ={4},Phase={'$(vPhase)'}, [Date set]={1} >}
DISTINCT ID)/COUNT (
{1<Overall={1,2,3,4}, Phase={'$(vPhase)'}, [Date set]={1} >}
DISTINCT ID),
COUNT (TOTAL {1<Overall={4},Phase={'$(vPhase)'}, [Date set]={1} >}
DISTINCT ID)/COUNT ( TOTAL
{1<Overall={1,2,3,4}, Phase={'$(vPhase)'}, [Date set]={1} >}
DISTINCT ID))
How would I add the new If statement in place of the bolded parts?
Thanks,
Jess
How about this:
Phase={"$(=Pick(Match(vPhase, 'Early', 'Late', 'All'), 'Early', 'Late', '*'))"}
Absolutely perfect!
Thank you so much (for the hundredth time this week!).
Best wishes,
Jess
Sunny has already suggested a best solution. Just thought to share suing If method.
Phase={'$(=IF(vPhase ='Early','Early',IF(vPhase='Late','Late','*')))'}
Ignore the red squiggly lines.
Hi Tamil,
Thank you - that's really useful!
One of the issues I was having was declaring my variables properly, so this will be a big help for next time!
Thanks again,
Jess