Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to create if else statement to set the QVD path dynamically if app moves from One space to another.
Let vSpaceName=GetSysAttr('spaceName');
Let vSpaceType = GetSysAttr('spaceType');
If '$(vSpaceName)'='' and '$(vSpaceType)' = '' then
Let vSource_Path ='';
Trace Data sourced from Personal Datafiles';
ElseIf WildMatch('$(vSpaceName)','*UAT*') then
Let vSource_Path = 'RBSPK FACTS Analysis ETL UAT'&':';
Trace Data Sourced from $(vSource_Path) space;
ElseIf WildMatch('$(vSpaceName)','*DEV*') then
Let vSource_Path = 'RBSPK FACTS Analysis ETL DEV'&':';
Trace Data Sourced from $(vSource_Path) space;
Else
Let vSource_Path = 'RBSPK FACTS Analysis ETL'&':';
Trace Data Sourced from $(vSource_Path) space;
EndIf
I am trying to get the dynamic path like this for each different space,
lib://$(vSource_Path)DataFiles/qvd/
Above script works fine in Personal space but fails in other spaces like DEV and UAT. Any suggestions ?
I was able to fix it, the issue was just unwanted Single Quote in Trace statement below.
Trace Data sourced from Personal Datafiles';
When i remove it then the If clause works as expected.
Thanks for you time everyone !!
Could be different reasons, access right, Case Sensitivity.
However I would start debugging by adding Trace statements to the beginning of the script in order to see, what values the variables evaluate to in the different spaces.
Something like:
Let vSpaceName = Alt(GetSysAttr('spaceName'), 'UnknownSpace');
Let vSpaceType = Alt(GetSysAttr('spaceType'), 'UnknownType');
Trace Space Name: $(vSpaceName);
Trace Space Type: $(vSpaceType);
If '$(vSpaceName)' = '' and '$(vSpaceType)' = '' then
Let vSource_Path = '';
Trace Data sourced from Personal Datafiles';
ElseIf WildMatch(Lower('$(vSpaceName)'), '*uat*') then
Let vSource_Path = 'RBSPK FACTS Analysis ETL UAT' & ':';
Trace Data Sourced from $(vSource_Path) space;
ElseIf WildMatch(Lower('$(vSpaceName)'), '*dev*') then
Let vSource_Path = 'RBSPK FACTS Analysis ETL DEV' & ':';
Trace Data Sourced from $(vSource_Path) space;
Else
Let vSource_Path = 'RBSPK FACTS Analysis ETL' & ':';
Trace Data Sourced from $(vSource_Path) space;
EndIf
Trace Library Path: lib://$(vSource_Path)DataFiles/qvd/;
Then test the script in the DEV and UAT space to see what's happening.
The part of: & ':' seemed to be wrong. What about: & '/'
I was able to fix it, the issue was just unwanted Single Quote in Trace statement below.
Trace Data sourced from Personal Datafiles';
When i remove it then the If clause works as expected.
Thanks for you time everyone !!