Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
user_friendly
Contributor
Contributor

SQL load script doesnt load data

Hi, hope someone can help me with my issue. I'm using Qlik Sense September 2017 version. When I want to load a SQL Script it doesn't load anything but there is no error message. The SQL Script works correct on a SQL Developer. It seems that the last left join (red marked) is causing the issue. Does someone know why?

 

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

LIB CONNECT TO 'reporting (ldap_username)';

 

SELECT
u.id,
u.datetime,
to_char(u.datetime, 'YYYYMM') "month",
u.customer_id,
u.customer_number cid,
u.msisdn,
u.brand,
CASE WHEN u.product = 'M-Budget Mobile Mini ' THEN 'M-Budget Mobile MINI'
WHEN u.product = 'M-Budget Mobile Maxi ' THEN 'M-Budget Mobile MAXI'
ELSE u.product
end as product,
u.product_id,
u.type_id,
u.event_type,
u.call_type_group,
u.call_type_name,
u.sec,
u.min,
u.kb,
u.mb,
u.gb,
u."sms/mms",
u.charge,
round(u.charge::numeric, 2) as charge_excl_vat,
round(u.charge::numeric*1.077, 2) as charge_incl_vat,
case when u.charge = 0 then 'yes' else null end as included,
u.billed,
u.invoice_nr,
u.gender,
u."language",
u.nationality,
u.cumulus,
u.wireline,
u.customer_status,
u.customer_age,
u.customer_age_group,
u.pay_method,
u.disp_method,
u.canton,
u.violated_usage,
u.violated_voice_national,
u.violated_voice_roaming,
u.violated_data_national,
u.violated_sms_mms_national,
u.violated_sms_mms_international,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_usage is not null then 1 else 0 end as violated_last_3months,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_voice_national = 1 then 1 else 0 end as violated_voice_national_last_3months,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_voice_roaming = 1 then 1 else 0 end as violated_voice_roaming_last_3months,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_data_national = 1 then 1 else 0 end as violated_data_national_last_3months,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_sms_mms_national = 1 then 1 else 0 end as violated_sms_national_last_3months,
case when date_trunc('month', u.datetime::date) > date_trunc('month', current_date - interval '3' month) and u.violated_sms_mms_international = 1 then 1 else 0 end as violated_sms_international_last_3months,
c.dunning_level current_dunning_level
FROM wingo_view_usage u
left join v_reporting_customers c on c.customer_id=u.customer_number
left join v_reporting_dunning_reminder d on d.customer_id=u.customer_number and to_char(d."date", 'YYYYMM')=to_char(u.datetime, 'YYYYMM')
where u.datetime >= '2018-01-01'
;

0 Replies