Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Setting up variable value in script

Hi,

I am trying to setup variable value as 01 instead of 1.

I can do that using below

let

vday='01';

But I want to loop above variable into For loop and when I add "1" to vday I get "2" but I am looking for "02" value.

Reson for doing this is I want to form a string so that I can read data from partition created in format ABC_2012_09_01,ABC_2012_09_02 etc

How to achieve this any idea?

Sample code

let

vPart='TRAN_PART_2012_12_';

let vday='01';

set vzero=0;

For i=1 to 31

set vMainPartition=$(vPart)$(vday);

Thanks

1 Reply
Not applicable
Author

You should use the Num() function to format a number in the way you want: Num(vday, '00') will use always two digits to show the vday value.