Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am building qlik app that builds QVDS for analysts to use however im getting a bit of a weird error im not sure how to resolve so i am using this bit of code to set the vTable to 'CostCentres'
but when stepping through it sets them as this below
When I check the only time I use the RefC prefix is later in the code by around 2 sections
so I'm not sure how its setting the vTable to RefC when it hasn't even run that bit of code ?
According to the middle image, vTable=CostCentres and that's what you set that variable to in the first image.
Line 6 in the first image probably sets vPrefix to (null) when it is executed, but maybe it isn't because of the if-statement that precedes it. Try using apostophes like this:
let vPrefix = '$(vTable)';
It is possible that vPrefix contains 'RefC' from a previous load.
Have you tried stepping through the script in debug mode to see what happens on each line?
@PDurnall Qlik capture the reload from top to bottom, It means when you find error in 8th line, but actually you already triggered till 7 lines, It means all the variables are stored into UI as script variable.
so when I'm trying to de bug line by line its actually 7 lines ahead of its self .. then why is it setting my prefix to
[RefC name of column] instead of [CostCentres Name of column]
So that isn't a solution
I have had to fix this instead by using
LET vPrefix = 'CostCentres';
Instead of
LET vPrefix = '$(vTable)';
According to the middle image, vTable=CostCentres and that's what you set that variable to in the first image.
Line 6 in the first image probably sets vPrefix to (null) when it is executed, but maybe it isn't because of the if-statement that precedes it. Try using apostophes like this:
let vPrefix = '$(vTable)';
It is possible that vPrefix contains 'RefC' from a previous load.
Have you tried stepping through the script in debug mode to see what happens on each line?
Yep when stepping through the code when it gets to line 6 on the first image it set the variable to RefC which isn't used for another 150-200 lines of code as image below Cost Centre is ran then future appointments and then RefC.
I added in the ' ' Around the Variable and this works just really strange it grabs code from much later to use as the variable