Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal_sanguri
Specialist
Specialist

one extra row

Hi All,

I was trying to execute below code.. and I think I should get only one row... however I am getting two..

a:

Load *

inline

[

field

Great_CAll

];

b:

load field,

SubField(field,'_CAll') as client

Resident a;

drop table a;

EXIT Script;

1 Solution

Accepted Solutions
sunny_talwar

You will get 2 because you have no specified the third argument. May be try this:

a:

Load *

inline

[

field

Great_CAll

];

b:

load field,

SubField(field,'_CAll', 1) as client

Resident a;

drop table a;

EXIT Script;

View solution in original post

6 Replies
sunny_talwar

You will get 2 because you have no specified the third argument. May be try this:

a:

Load *

inline

[

field

Great_CAll

];

b:

load field,

SubField(field,'_CAll', 1) as client

Resident a;

drop table a;

EXIT Script;

kamal_sanguri
Specialist
Specialist
Author

Hi Sunny,

I was 100% sure that you will give me answer for this.. thanks.. could you elaborate it.. I still don't understand, why it is giving an additional row?

susovan
Partner - Specialist
Partner - Specialist

Hi Kamal,

Try This

a:

Load *

inline

[

field

Great_CAll

];

b:

load field,

SubField(field,'_CAll','_') as client

Resident a;

drop table a;

EXIT Script;

Warm Regards,
Susovan
sunny_talwar

Without the third argument SubField behaves like a loop. Since there is only one _CAll it will loop twice. If there were 2, then it would have looped thrice. So general rule here is if you have n _CAll, it will loop n+1 times. In your case you might think that there is nothing after _CAll, but it will still create an extra row with empty cell. Does that make sense?

susovan
Partner - Specialist
Partner - Specialist

kamal_sanguri
Specialist
Specialist
Author

absolutely.. learnt new thing..