Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Multiple Where clause & data issue

I have data in following format:

DateClassGradeTeacherNotes
2017-05-28English5-dfadf
2017-05-29Math6Ms Walshdafd
2017-05-20Science10Ms Helendafdaf
2017-05-14Chemistry-Mr. Tom

I want to create 2 where clause where i can look for:

1) during load script, delete the row where Grade is Null.

2) during load script, delete the row where Teacher is null.

DateClassGradeTeacherNotes
2017-05-29Math6Ms Walshdafd
2017-05-20Science10Ms Helendafdaf
10 Replies
sunny_talwar

May be like this

LOAD Date,

     Class,

     Grade,

     Teacher,

     Notes

FROM ...

Where Len(Trim(Grade)) > 0 and Len(Trim(Teacher)) > 0;

userid128223
Creator
Creator
Author

Thanks Sunny.


I tried your method, Chemisty still shows up.

sunny_talwar

Seems to work for me using Inline table load here:

Table:

LOAD * INLINE [

    Date, Class, Grade, Teacher, Notes

    2017-05-28, English, 5, , dfadf

    2017-05-29, Math, 6, Ms Walsh, dafd

    2017-05-20, Science, 10, Ms Helen, dafdaf

    2017-05-14, Chemistry, , Mr. Tom

]

Where Len(Trim(Grade)) > 0 and Len(Trim(Teacher)) > 0;

userid128223
Creator
Creator
Author

i am doing it from excel. only difference i see between Empty Teacher vs Grade is that:

Teacher = blank

Grade = -

would that cause and issue?

sunny_talwar

It could very well be... there might be a character which is different from a space... may be try this

Table:

LOAD * INLINE [

    Date, Class, Grade, Teacher, Notes

    2017-05-28, English, 5, , dfadf

    2017-05-29, Math, 6, Ms Walsh, dafd

    2017-05-20, Science, 10, Ms Helen, dafdaf

    2017-05-14, Chemistry, , Mr. Tom

]

Where Len(Trim(Grade)) > 0 and Len(Trim(KeepChar(Upper(Teacher), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) > 0;

or something similar

userid128223
Creator
Creator
Author

file attached

userid128223
Creator
Creator
Author

tried same result. i attached the file.

userid128223
Creator
Creator
Author

any clue as to why it won't work?

Digvijay_Singh

Looks lilke you got text char '-' inside grade -

This works but you may need to understand what this char means.

Data:

LOAD Date,

     Class,

     Grade,

     Teacher,

     Notes

FROM

where.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Len(Trim(Grade)) > 0 and Len(Trim(Teacher)) > 0 and Grade <>'-';