Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
its_rajvir
Creator
Creator

Script Function

Hi Experts,

I have the script mentioned below. Can anyone explain its working please, i am  little confused. 

if Len(Trim('$ (vStartDate)'))=0 then
Let vStartDate = Date(Today());
EndIf

if Len(Trim('$ (vEndDate)'))=0 then
Let vEndDate = Date(Today()+1);
EndIf

Let vStartDate = Date('1/1/2021');

Let vEndDate= Date('30/1/2021');

Thanks in Advance 

Help!

Labels (4)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

It doesn't make much sense to me. There are two if blocks that set the variables vStartDate and vEndDate to respectively today's and tomorrows date if those variables didn't have a value already. Ok, that makes sense. But then the next two Let statements simply set those same variables to the 1st and 30st day of january. And so those if blocks are totally useless.


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

It doesn't make much sense to me. There are two if blocks that set the variables vStartDate and vEndDate to respectively today's and tomorrows date if those variables didn't have a value already. Ok, that makes sense. But then the next two Let statements simply set those same variables to the 1st and 30st day of january. And so those if blocks are totally useless.


talk is cheap, supply exceeds demand