Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pra_kale
Creator III
Creator III

Error in script..For loop

Hi,

I have attached one application in which just for practice purpose written a code to generate random rows in fact table.

But the script is giving error at '120' row FOR L=1 to $(vPCount) .

Can you please guide me to know what is wrong in the script.

Thanks in advance

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

I think, character 'c' is missing in your variable, instead of vDateFactor, you written vDateFator..

let vDateFactor = pow(2,$(vWeekDay)) * (1-(Year(now())-Year($(vOrderDate)))*0.05);

// Calculate the random number of lines

let vPCount = Floor(Rand()*$(vDateFactor)) + 1;

View solution in original post

3 Replies
swuehl
MVP
MVP

seems like your vPCount variable hasn't survived your script reload and I can't reload your script (missing the input table).

I would suggest that you run your script in debug mode of the script editor and carefulls watch each variable being created correctly.

settu_periasamy
Master III
Master III

Hi,

I think, character 'c' is missing in your variable, instead of vDateFactor, you written vDateFator..

let vDateFactor = pow(2,$(vWeekDay)) * (1-(Year(now())-Year($(vOrderDate)))*0.05);

// Calculate the random number of lines

let vPCount = Floor(Rand()*$(vDateFactor)) + 1;

pra_kale
Creator III
Creator III
Author

Thanks Swuehl and Settu for your Help..!!