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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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
sunny_talwar

Why are some of your months MMM-YY and Other MMMYYYY ?

Anyways, you can use a where clause to handle this

WHERE DateField  >= MonthStart(Today(), 5);

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

Thanks for the reply.

but i am getting same data only.

sunny_talwar

Can you share the script you tried

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

Please find it below.

LOAD

Category,val,GYR_Month,MonthName(GYR_Month) as GYR_Month1,

field1

Resident GYR

Where

  GYR_Month  >= MonthStart(Today(), 5)

;

sunny_talwar

It was my bad.... forgot to add - next to 5

GYR_Month  >= MonthStart(Today(), -5)

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

Thanks for the reply.

i tried this also, but getting same data,its not filtered in script.

GYR_Month  >= MonthStart(Today(), -5)

sunny_talwar

How is GYR_Month read by qlikview? Is it able to recognize it as a date field or not?

vidhya91gct
Partner - Contributor
Partner - Contributor
Author

GYR is Date field .

for example (i have changed the date to month)

GYR_Month

Mar 2018            1/03/2018

sunny_talwar

Do you have anything more going on except for this load?

LOAD Category,

     val,

     GYR_Month,

     MonthName(GYR_Month) as GYR_Month1,

     field1

Resident GYR

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

Are you dropping GYR after this load??