Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am getting control statement error. If this can be written in if statement or case anything should be fine. if possible can anyone send in qvw file.
@
Script :
let vDEPT_EXCLUSIONS='CAPITAL_PROJECTS'; // if this variable is equal to CAPITAL_PROJECTS then it will have project id filters in the script or else no Project ID filter will be there
let vProjectID=4;
let vDEPT_EXCLUSIONS=CAPITAL_PROJECTS;
Switch $(vDEPT_EXCLUSIONS)
Case 'CAPITAL_PROJECTS'
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
Account Node3, 3
Account Node4, 4
Account Node5, 5 ]
;
Default
Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
]
;
End Switch
EXIT SCRIPT;
let vDEPT_EXCLUSIONS='CAPITAL_PROJECTS'; // if this variable is equal to CAPITAL_PROJECTS then it will have project id filters in the script or else no Project ID filter will be there
let vProjectID=4;
IF ('$(vDEPT_EXCLUSIONS)'='CAPITAL_PROJECTS') THEN
// 5 rows
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
Account Node3, 3
Account Node4, 4
Account Node5, 5 ]
;
ELSE
// 2 rows
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
]
;
ENDIF
maybe
[Dimensions Self Service]:
instead of
Dimensions Self Service]:
Massimo that was not the problem either i will attach the QVW file let me do that
How are you Massimo long time . technically i should get 4 rows but i am getting 2 rows . even if we use IF statement also i am fine with that
replace
Switch $(vDEPT_EXCLUSIONS)
with
Switch '$(vDEPT_EXCLUSIONS)'
I get 5 rows
Massimo can we get the same output with if statement can you please provide me the script sorry for a direct question. For some reason i cannot get it to work
let vDEPT_EXCLUSIONS='CAPITAL_PROJECTS'; // if this variable is equal to CAPITAL_PROJECTS then it will have project id filters in the script or else no Project ID filter will be there
let vProjectID=4;
IF ('$(vDEPT_EXCLUSIONS)'='CAPITAL_PROJECTS') THEN
// 5 rows
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
Account Node3, 3
Account Node4, 4
Account Node5, 5 ]
;
ELSE
// 2 rows
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
]
;
ENDIF
let vDEPT_EXCLUSIONS='CAPITAL_PROJECTS'; // if this variable is equal to CAPITAL_PROJECTS then it will have project id filters in the script or else no Project ID filter will be there
let vProjectID=4;
Switch '$(vDEPT_EXCLUSIONS)'
Case 'CAPITAL_PROJECTS'
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
Account Node3, 3
Account Node4, 4
Account Node5, 5 ]
;
Default
[Dimensions Self Service]:
LOAD * INLINE [
_Dimension, _DimensionID
Account, 1
Account Name, 2
]
;
End Switch