Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone!
This are all the years from my data. Jaar is the Dutch word for year.
This is in my script:
LOAD Number,
(JAAR+2000) as JAAR,
FROM
\source
(qvd);
My question is: Can I said in my data that I only want to see the max year, and 3 other. In this case: 2015, 2014, 2013 and 2012?
Or is this impossible.
I know I ask something like this in another post, but this is an better one.
Thanks!
If you want to just show Latest 4 years in your list box .
Then just create a variable
Var1=max({1}JAAR)-4
then select list box and use expression in place of field name
in expression write
=if(JAAR>=Var1,JAAR)
it will show you four latest year.
If this is not your requirement let me know .
Thanks
BKC
Try Preceding Load:
Load *
Where JAAR >= '2012;'
LOAD Number,
(JAAR+2000) as JAAR,
FROM
\source
(qvd);
If you don't want to load the data of earlier years you can use a where clause:
LOAD Number,
(JAAR+2000) as JAAR,
FROM \source (qvd)
WHERE JAAR >=12;
If you do want to load the data, but want to filter it in the front end there are several ways. You could simply select the years you want to see. This is the easiest solution. You could create a bookmark for that selection so you can easily return to that selection.
Hi Lieko
You could add a simple where condition on the load, or create something a bit more dynamic based on your data.
Something like the below should work.
MaxYear:
LOAD Distinct
Max((JAAR+2000)) as JAAR,
FROM
\source
(qvd);
Let vMaxYear =Peek('JAAR')
Drop table MaxYear;
LOAD Number,
(JAAR+2000) as JAAR,
FROM
\source
(qvd)
Where (JAAR+2000) > $(vMaxYear-3);
Hope that helps
Joe
Hi lieko,
You can write below code in you script editor while loading your data.
LOAD *,
(JAAR+2000) as JAAR,
FROM \source (qvd)
WHERE JAAR >='2012';
Regards,
Priyanka
You can try something like this:
Year_start = year(yearstart(AddMonths(today(), -36))); //-36 means the number of years from now in months 12x3=36
Year_today = year(yearstart(AddMonths(today(), 0)));
Jaar:
LOAD Number,
(Jaar+ 2000) as Jaar
FROM \source
where (Number + 2000)>='$(Year_start)' and (Number + 2000)<='$(Year_today)';
Hope that helps
If you want to just show Latest 4 years in your list box .
Then just create a variable
Var1=max({1}JAAR)-4
then select list box and use expression in place of field name
in expression write
=if(JAAR>=Var1,JAAR)
it will show you four latest year.
If this is not your requirement let me know .
Thanks
BKC
Thanks alll! The option of BKC is the easiest one for me. It was correct!
And if I want to show the years 2010, 2011, 2012, 2013?
Than can I not use max year