Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have variables as follows:
vCurrentYear=Year(Today())
vPreviousYear=Year(Today())-1
The script as:
| LOAD | Distinct | ||
| [Year Count] as [Year], | |||
| [From Month], | |||
| [From Month No], |
FROM Calender_Dimension.qvd(qvd)
where Match(year([Calendar Date]),'$(vCurrentYear)','$(vPreviousYear)');
when i reload it is throwing error.
can any 1 tell y?
you schould add Match(year([Calendar Date]),'$(vCurrentYear)','$(vPreviousYear)')=1 or 2 .depending on which year you want to filter data .
check help (F1) for more explication nabout match function .
s they r typo graphical errors
i have years from 1980 to 2020 i cant use >= and <= i have to use match.
r u tried tis way,
Match(year([Calendar Date]),Year(Today() ),Year(Today() - 1)) --some how work around.
the problem with ur match function syntax.
Hi,
can you modify your script by this one?:
LOAD Distinct Year Count] as [Year],
[From Month],
[From Month No]
from Calender_Dimension.qvd(qvd)
where year([Calendar Date]) >= $(vPreviousYear) and year([Calendar Date]) <= $(vCurrentYear)
**Notice that I removed the comma after the [From Month No] field, it could be the main error
**Also i removed the single quote of the variables
Please, check it and modify what you need, but I think this is the way
Hi Prudvi,
Check the below script,
vCurrentYear=Year(Today());
vPreviousYear=Year(Today())-1;
LOAD Distinct
[Year Count] as [Year],
[From Month],
[From Month No]
FROM Calender_Dimension.qvd(qvd)
where Match(year([Calendar Date]),'$(vCurrentYear)','$(vPreviousYear)');
You could use this variable
vFromDate=YearStart(Year(Today())-1);
With this Where clause
FROM Calender_Dimension.qvd(qvd)
where [Calendar Date] >= $(vFromDate);
Hi all, i tried in the same way for which i marked as correct answer ; the only wrong was that my file was a corrupted one.....
I made it new n its working fine.
once again thanks to this huge response:)