Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

katetsan
New Contributor II

Convert format of SAP Table-Field "TCURR-GDATU"

Hi Communities,

I'm trying to extract data in specific time period from SAP "TCURR" table via Connector regarding the field "GDATU".

Since the data format of TCURR-GDATU is like '79829298', which means 2017/07/01, I'm wondering if I could convert the format with where clause in sql script.

I've tried cast and convert function as below, but it showed that there's no such functions like cast() and convert().

Thanks in advanced.

***** Script *****

SET vStartDate = '20170601';

SET vEndDate = '20170630';

Let vStart_Convert = Num#('99999999','########')- Num#($(vStartDate),'########');

Let vEnd_Convert = Num#('99999999','########')-Num#($(vEndDate),'########');

[TCURR]:

LOAD MANDT,

KURST,

FCURR,

TCURR,

GDATU,

UKURS,

FFACT,

TFACT,

Date(Date#(Evaluate('99999999')-NUM#(GDATU),'YYYYMMDD')) as GDATE;


Select

MANDT,

KURST,

FCURR,

TCURR,

GDATU,

UKURS,

FFACT,

TFACT

From TCURR WHERE (Convert(INT,GDATU)>=$(vStart_Convert) and Convert(INT,GDATU)<=$(vEnd_Convert));

1 Reply

Re: Convert format of SAP Table-Field "TCURR-GDATU"

Hi Kate,

You can pull all the data from SAP and filtered out in the Load Script. (I think TCURR will be less data)

SET vStartDate  = '20170601';
SET vEndDate    = '20170730';
LOAD
MANDT,
KURST,
FCURR,
TCURR,
GDATU,
UKURS,
FFACT,
TFACT,
Left(99999999 - GDATU,8) as GDATE
FROM [TCURR.qvd](qvd)
WHERE ( Left(99999999 - GDATU,8) >='$(vStartDate)' and Left(99999999 - GDATU,8) <='$(vEndDate)');

SELECT * From TCURR;

Community Browser