Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello! Can someone explain me, please, why does
LET vMonthStart=MonthStart(max(Date));
//Date is a field of previously loaded table
cause a script line error?
Regards,
Alexa
With code like this
TempTable1: |
LOAD
Max( Date) as MaxDate |
Resident FACT;
Let vMaxDateNum = Num( Peek( 'MaxDate', 0, 'TempTable1'));
Let vMaxDate = Date( $(vMaxDateNum));
LET vMonthStart=MonthStart(FieldValue('MaxDate', 1));
LET vPeriod=$(vMaxDate)-$(vMonthStart);
it almost works=)))
I get an error "script line error LET vPeriod=08.12.2014-01.12.2014"
what does Qlik need to be this right? date#, num() doesnt work as well...
Thanks, Yoann.
With code like this
TempTable1: |
LOAD
Max( Date) as MaxDate |
Resident FACT;
Let vMaxDateNum = Num( Peek( 'MaxDate', 0, 'TempTable1'));
Let vMaxDate = Date( $(vMaxDateNum));
LET vMonthStart=MonthStart(FieldValue('MaxDate', 1));
LET vPeriod=$(vMaxDate)-$(vMonthStart);
it almost works=)))
I get an error "script line error LET vPeriod=08.12.2014-01.12.2014"
what does Qlik need to be this right? date#, num() doesnt work as well...
LET vPeriod=$(vMaxDate)*1-$(vMonthStart)*1;
doesnt help=( same error
Hi, Try this code.
LET vPeriod=Num('$(vMaxDate)')-Num('$(vMonthStart)');
Best Regards.
Tonial.
It doesnt work=(
Qlik counts everithing exept
period
Hi, try this.
LET vPeriod=$(vMaxDateNum)-$(vMonthStartNum);
Best Regards.
Tonial.
hmmm... now it works=))))
Thank you!=)
But I really dont understand its logic...
Maybe this error occurring because the QlikView interpreting this variable (vMaxDate and vMonthStart) as text instead of number or date.