Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm unable to assign max and min values to the variables.I'm getting error ,here is my code is there any fault,can any one help me out from this.
Sheet1:
LOAD
BusinessDate,
Year(BusinessDate) as Year,
BusinessID,
CustomerName,
Location,
ShipperID
FROM
(biff, embedded labels, table is Sheet1$);
Let vMin=Min(Year);
Let vMax=Max(Year);
For i=$(vMin) to $(vMax);
NoConcatenate
T:
LOAD *
Resident Sheet1
Where Year=$(i);
STORE T into $(i).qvd;
Drop Table T;
NEXT i;
Brefore loading excel sheet create another load
MinMax:
Load min(year) as MinYr,
Max(year) as Maxyr
FROM
(biff, embedded labels, table is Sheet1$);
store this into varibles
then use in script
HTH
Vikas
You could use peek() or fieldvalue() to grab the values from a table how suggested from Vikas Mahajan - see here for examples: http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/08/peek-vs-previous-when-to-use-each.
But there is a better way especially by large fact-tables: http://qlikviewcookbook.com/2013/09/fastest-method-to-read-maxfield-from-a-qvd/
- Marcus