Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to display last three yr

Hello All,

On a text box i wrote a  action,,which should fire when ever i click on text box, and it should select max last three  year from YEAR field...

In Textbox---->action---->select in field------>Field:YEAR

search in String:

='>='& max((YEAR)-2)&'<='&MAX(YEAR)

which was working great when it was like this

year(DATE_OF_REVIEW) as YEAR

i apply this  transformation on YEAR field

'FY'& Date(AddYears(yearstart (DATE_OF_REVIEW, 1, 4),-1),'YY')  &'-'& Date(yearstart (DATE_OF_REVIEW, 1, 4),'YY') as YEAR

so how can i make it work again

    SuppilerScore:

LOAD

CLIENT,

     //LIFNR,

     VENDOR_NAME,

     ROLE,

     DATE_OF_REVIEW,

   

     QM_SCORE,

     //QM_MAX,

     CS_SCORE,

    // CS_MAX,

     GENERAL_SCORE,

     //GENERAL_MAX,

     PROC_SCORE,

    // PROC_MAX,

     MANU_SCORE,

    // MANU_MAX,

     round(TOTAL_SCORE) as TOTAL_SCORE ,

    

     //MAX_SCORE

      //'Q'&Ceil(MONTH(DATE_OF_REVIEW)/3) AS QUATERS,

   // year(DATE_OF_REVIEW) as YEAR

        pick(match(month(DATE_OF_REVIEW),'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),

'Q4','Q4','Q4','Q1','Q1','Q1','Q2','Q2','Q2','Q3','Q3','Q3') as QUATERS,

'FY'& Date(AddYears(yearstart (DATE_OF_REVIEW, 1, 4),-1),'YY')  &'-'& Date(yearstart (DATE_OF_REVIEW, 1, 4),'YY') as YEAR

// Year(yearstart (DATE_OF_REVIEW, 1, 4)) as YEAR

FROM

[..\QVDS\SuppilerScore.qvd]

(qvd);

CrossTable(QUALITY,SCORE,8)

LOAD

CLIENT,

VENDOR_NAME as name1,

     ROLE,

     DATE_OF_REVIEW,

     TOTAL_SCORE,

     QUATERS,

     YEAR,

    YEAR&QUATERS AS YEARQUATER ,

      QM_SCORE AS [Quality Management],

       CS_SCORE as [Customer Service],

     GENERAL_SCORE as General,

    PROC_SCORE as Procurement ,

   MANU_SCORE as Manufacture 

  Resident SuppilerScore;

    DROP Table SuppilerScore;

thanks

naveen

1 Solution

Accepted Solutions
sunny_talwar

How about this:

Dual('FY' & Date(AddYears(YearStart (DATE_OF_REVIEW, 1, 4), -1), 'YY')  & '-' & Date(YearStart (DATE_OF_REVIEW, 1, 4), 'YY'), Year(YearStart(DATE_OF_REVIEW, 1, 4))) as YEAR

View solution in original post

3 Replies
sunny_talwar

How about this:

Dual('FY' & Date(AddYears(YearStart (DATE_OF_REVIEW, 1, 4), -1), 'YY')  & '-' & Date(YearStart (DATE_OF_REVIEW, 1, 4), 'YY'), Year(YearStart(DATE_OF_REVIEW, 1, 4))) as YEAR

kunkumnaveen
Specialist
Specialist
Author

Thanks.....   it worked,if u got a chance would u plz brief me wat have u done....

sunny_talwar

When you were using this:

'FY'& Date(AddYears(yearstart (DATE_OF_REVIEW, 1, 4),-1),'YY')  &'-'& Date(yearstart (DATE_OF_REVIEW, 1, 4),'YY') as YEAR

YEAR was a text field. Using a Dual function, I assigned it a numerical value while still keeping its text format.