Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
How can i get last &first 3 weeks data.
Regards,
Mahesh.
Try this:
Temp:
LOAD Max(weeks) - 22 as Max
FROM
WEEKS.xlsx
(ooxml, embedded labels, table is Sheet1);
LET vPick = Peek('Max', 0, 'Table');
DROP Table Temp;
Table:
Directory;
LOAD ID,
weeks,
Sales
FROM
WEEKS.xlsx
(ooxml, embedded labels, table is Sheet1)
Where weeks >= $(vPick);
In the script or an expression?
Hi Sunny,
I have date field, i need in script level. please can you share with expression also.
Regards,
Mahesh.
One more question, what do you mean when you say last and first 3 week date? So 3 weeks from beginning or your data and 3 weeks to the end of your data
Hi Sunny,
3 weeks to the end of my data.
Regards,
Mahesh.
I am not 100% sure I understand, can you share some raw data with the expected output?
Hi Sunny,
please find my attached file.
Here i want 9-31 dates sales(3 weeks).
Regards,
Mahesh.
Try this:
Temp:
LOAD Max(weeks) - 22 as Max
FROM
WEEKS.xlsx
(ooxml, embedded labels, table is Sheet1);
LET vPick = Peek('Max', 0, 'Table');
DROP Table Temp;
Table:
Directory;
LOAD ID,
weeks,
Sales
FROM
WEEKS.xlsx
(ooxml, embedded labels, table is Sheet1)
Where weeks >= $(vPick);
Hi Bro,
Superb ,It 's working perfectly.
I need your one more help i want to change dynamically based on date field.
Regards,
Mahesh.
This is dynamic based on the date field. This will always bring in the most recent 3 weeks based on the maximum date available in your database