Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
merry2018
Creator III
Creator III

Where Statement in the Load Script

Hello Together,

I try to get an conditional Statement in a Load Script, with them I will take only the Data where have the same Date how the Datefild, but it don't work.

I tried with the following Code, in three possible ways:

Tab2:

LOAD *

//**1. Way**

Where Datefild= %Key_Datum;

LOAD

KEY_Artikel,

Key_Datum,

Datefild,

//**2. Way**

//if (Datefild = %Key_Datum, taeglMenge, 0)

taeglMenge

Resident Tab1

//**3. Way**

//Where Datefild = %Key_Datum_Kalender; //date(,'DD.MM.YYYY')

;

If the Datefild and %Key_Datum are the same, it sould be in the table, all other are not.

The Table have following Dates for example:

KEY_ArtikeltaeglMengeKey_DatumDatefild
TeilA1010.04.201809.04.2018
TeilA1010.04.201810.04.2018
TeilB2513.04.201811.04.2018
TeilB2513.04.201812.04.2018
TeilB2513.04.201813.04.2018
TeilA2014.04.201811.04.2018
TeilA2014.04.201812.04.2018
TeilA2014.04.201813.04.2018
TeilA2014.04.201814.04.2018
TeilC3015.04.201814.04.2018
TeilC3015.04.201815.04.2018

And I will have only the yellow marked Data, because there are the Fields "Key_Datum" and "Datefild" the same.

In the Code are 3 ways, but all of they not working, they bring no data.

1 Solution

Accepted Solutions
merry2018
Creator III
Creator III
Author

I tested it with the table Box and there i mean it is the same, but the way with only the where after the Resident (3d way)

Where DayStart(Datefild) = DayStart(%Key_Datum_Kalender);

don't worked.

But the first way suddenly doing, with the following changing:

LOAD *

where DayStart(Datefild) = DayStart(%Key_Datum_Kalender);

so now I have a table with only the wished Data.

Is it possible that the conditional only before in a second Load working and not in the same Load with a where after the resident

?

View solution in original post

2 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Create an object (for example a Table Box) in which you display the numerical value of those two date fields (use the PRoperties->Number tab settings for that). The date strings are the same, but are the numerical values also identical?

If not, then add DayStart() or Floor() to each side of relation expression i nyour WHERE cvaluse to get a proper comparison.

merry2018
Creator III
Creator III
Author

I tested it with the table Box and there i mean it is the same, but the way with only the where after the Resident (3d way)

Where DayStart(Datefild) = DayStart(%Key_Datum_Kalender);

don't worked.

But the first way suddenly doing, with the following changing:

LOAD *

where DayStart(Datefild) = DayStart(%Key_Datum_Kalender);

so now I have a table with only the wished Data.

Is it possible that the conditional only before in a second Load working and not in the same Load with a where after the resident

?