Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
vidhya91gct
Partner - Contributor
Partner - Contributor

Last 5 month of data from current month in load script.

Hi All ,

Please help me on the below,

 

MonthCategoryfield
Aug-17AH
Sep2017 BI
Nov-17CG
Dec2017 DK
Jan-18EL
Fe b2018 FM
Mar-18GN

it is my final data.

I want to show the latest 5 month data.

16 Replies
vidhya91gct
Partner - Contributor
Partner - Contributor
Author

month.PNG

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

Please find the above image for loading file

i used in script,

LOAD Category,

     val,

     Month,

   

     field1

Resident GYR

Where GYR_Month  >= MonthStart(Today(), 5);


but getting same month only


sunny_talwar

Are you dropping GYR?

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

yes, i will drop the GYR table.

sunny_talwar

Would you be able to share the app?

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

sorry, i couldn't able to share the data,

I have attacted in the below image,

I need to show the highligted 5 month data in chart table.month.PNG

sunny_talwar

This worked for me...

GYR:

LOAD Date(Date#(Month, 'MMM-YY'), 'MMM-YY') as Month,

Category,

field;

LOAD * INLINE [

    Month, Category, field

    Aug-17, A, H

    Sep-17, B, I

    Oct-17, C, J

    Nov-17, D, K

    Dec-17, E, L

    Jan-18, F, M

    Mar-18, G, N

];


Final_GYR:

LOAD Category,

Month,

    MonthName(Month) as GYR_Month1,

    field

Resident GYR

Where Month  >= MonthStart(Today(), -5);


DROP Table GYR;