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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_ryuke
Partner - Contributor II
Partner - Contributor II

Load 6 month's of data

I need help to 6 month's of data from GCP 

GCP column is GCP_Date 

GCP_Date format is - DD/MM/YYYY HH:MM:SS AM/PM

 

LOAD

GCP_Date as Date,

Id as ID,

Name ;

 

Sql

Select 

GCP_Date,

Id,

Name 

From gcp_view

Where

GCP_Date > Date_Sub(format(now(), 'DD/MM/YYYY HH:MM:SS TT'), -180 Day);

 

 

Can anyone help with where clause condition for this.

The above one didn't work

Labels (1)
1 Reply
Aunitha
Partner - Contributor II
Partner - Contributor II

Hi @sunny_ryuke, Try this

// Step 1: Calculate the date 6 months ago from today

let currentDate = Date(Today());

let sixMonthsAgo = Date(AddMonths(currentDate, -6), 'DD/MM/YYYY');

// Step 2: Load your data with a WHERE clause to filter dates

LOAD

GCP_Date,

Value

FROM your_data_source

WHERE GCP_Date >= $(sixMonthsAgo);