Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i am writing the condition looks like
=If(Program='1','23018_INTd_PHEV',
If(Program='2','23201_INTd_Gas 13 kph',
If(Program='3','23201_INTd_Gas 13 kph',
If(Program='4','24043_INTd_5Dr_Base_SS_Base',
If(Program='5','23653_INTd_RC_4x4_Gas_Common',
If(Program='6','23201_INTd_Gas 13 kph',
if(Program='7','23201_INTd_Gas 13 kph',
if(Program='8','23201_INTd_Gas 13 kph',
if(Program='9','23784_INTd_NE 13 kph','23006_INTd_Gas')))))))))
my dashboard is working fine.
but i have programs upto 30 programs are available. i need to do Automation.
with out writing if condition can we select Program filter to display the result. any other alternate method please suggest.
Thanks.
Hello,
To simplify further your example and to avoid writing new nested if statements each time, you can follow the steps below:
1. Create a new load for the severities:
2. Now you can modify the charts as follows:
This method, doesn't require nested if statements, because:
With this method, in case you need to add new severity, you just add it in the load script and then update the charts with additional line for the expression. Without needing to do if statements.
Your charts when Severity1 is selected:
My charts when Severity1 is selected:
As you can see they are the same so it is working!
I hope that this information is helpful.
Hello @nvijay5757,
Perhaps the following use case scenario might help you:
1. You can load the ProgramNumber and ProgramCode as a value (Either with Load Inline statement or EXCEL file etc.):
2. After that I have loaded a demo dataset:
3. Now I want to create a measure that will show the ProgramCode. Instead of having multiple nested if statements as you have mentioned, I have used the following expression: SubField(Concat(ProgramCode, ','), ',', Program)
This expression will:
4. Outcome is:
NOTE: Since we have ProgramNumber associated with ProgramCode, you can also use this in other use case scenarios.
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.
Hi,
Thanks for your reply.
i am attaching sample data and QVF can you please look into that and suggest.
in that two charts are showing data in that i have used if condition and variables.
main aim is with out writing if condition can we select Program filter to display the result.
like automation. if we add further multiple programs.
Thanks again.
Hello,
To simplify further your example and to avoid writing new nested if statements each time, you can follow the steps below:
1. Create a new load for the severities:
2. Now you can modify the charts as follows:
This method, doesn't require nested if statements, because:
With this method, in case you need to add new severity, you just add it in the load script and then update the charts with additional line for the expression. Without needing to do if statements.
Your charts when Severity1 is selected:
My charts when Severity1 is selected:
As you can see they are the same so it is working!
I hope that this information is helpful.
Hi,
Thanks
can you please share app.
Hi,
Thanks.
1. in variable we have written if statement.
2. if any new program added then will add the description details every time.
3. our intention is to avoid every time description details.
Hello,
Yes sure! Here is the app. I hope it helps