cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation Logic

Former Member
0 Kudos

Hi Experts,

I am trying to load data from a CSV file.

I have a date field through which i am trying to populate value for a field called Status. Logic is, If the Date field is empty then status =2 else status =1.

Simple logic but don't know where am going wrong!!!

I have used routine and formula but both didn't work. Status "1" is successfully loading to the fields in which Date is not Empty but Status is not Loading at all, All the time it is showing empty only...

I have tried with ' ' , '00.00.0000' and '00000000' ... but none of them are working...

This is the result what am getting every time...

Activation DateActivated ByActivation Status
11-11-2010DATA  ENTRY1
11-11-2010DATA  ENTRY1
12-11-2010DATA  ENTRY1
16-11-2010DATA  ENTRY1
16-11-2010DATA  ENTRY1
22-11-2010DATA  ENTRY1
##Not assigned
##Not assigned
##Not assigned
##Not assigned

Please suggest some inputs, Highly appreciate your help.

Thanks & Regards,

Anil.

Accepted Solutions (1)

Accepted Solutions (1)

KulDeepJain
Active Participant
0 Kudos

Hi Anil,

Your requirement is simple enough. Use below code for that;

IF source_fields-/BIC/IOcalday is not initial.

  RESULT = '1'.

  ELSE.

     RESULT = '2 '.

ENDIF.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Check if this helps:

IF SOURCE_FIELDS-calday is initial.

  RESULT = '2'.

  ELSE.

     RESULT = '1 '.

ENDIF.

Former Member
0 Kudos

Already I have tried it Sir, But It is not working...

Data is loading only for the records which has date..

Thanks for your reply.

Answers (4)

Answers (4)

anshu_lilhori
Active Contributor
0 Kudos

Hi,

You can achieve the same at bex level itself.

Make formula variable with replacement path for your date cahractersitic to convert it inot KF.

In Unit/dimension tab choose--date

Then write simple if else condition:

Make anew formula put this formula variable(F1)

(F1<>0)*1+(F1==0)*2

Hope this helps.

Regards,

AL

Former Member
0 Kudos

Thanks AL, But I need to use this Char in the filter section of the report.

So I have to load the date for sure.

anshu_lilhori
Active Contributor
0 Kudos

Hi,

When your are loading that data in PSA or DSO then what values you are getting for blank dates.

Can you just confirm it .

Regards,

AL

anshu_lilhori
Active Contributor
0 Kudos

Hi,

I just tried on my system and its working fine.

if SOURCE_FIELDS-CALDAY ne ' '.

      RESULT = 1 .

      else .

        RESULT = 2.

        ENDIF.

Regards,

AL

Former Member
0 Kudos

Thanks AL for ur Support, I hav identified the issue.

Now the issue has been resolved....

Applied the same logic and corrected the format in the source system..

Thank u once again.

amine_lamkaissi
Active Contributor
0 Kudos

Actually, regarding your example, empty values are designed by '#".

Try this:

IF date eq '#"

  RESULT = '2'.

  ELSE

     RESULT = '1 '.

ENDIF.

Amine

former_member182343
Active Contributor
0 Kudos

Hi,

Try to restrict Query on Date characteristic with #.

Try this :

IF source_package-/BIC/IOcalday is not initial.
  RESULT = '1'.
  ELSEIF
     RESULT = '2 '.
ENDIF.


Former Member
0 Kudos

Hi Anil,

Try by giving as

if date eq ' '

then status = 2.

else status = 1.

Regards,

Saurabh Singh