Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created a document using where not exists to get distinct categories of records. But it creates 3 field.
Can someone please help me create all three categories in a single field instead of three individual fields?
Any help is highly appreciated.
Current situation: Catogory A, B, and C are in differernt fields,
It woul dbe great to see it in a single field.
Thanks!
Not sure if I understand your requirement correctly, but yes, the input table needs to be sorted properly to make this approach work. If your sort order is a little uncommon (i.e. default ORDER BY FIELD ASC/DESC does not work), you may need to map a sort order to Category and sort by this field.
How do you want your final table to look like? Currently it looks like this after your reload
What do you expect to see differently in the above image?
Req. O/P:
Category SKU
A 1
A 2
A 3
B 4
C 5
Just this?
Table1:
LOAD * Inline
[
SKU, Category
1, A
1, B
1, C
2, A
2, B
3, A
3, B
3, C
4, B
5, C
] WHERE NOT EXISTS(SKU);
May be like attached
This is what I'm exactyl looking for Sunny.
But as @stefanWuhl mentioned, can't we just use Not Exists (SKU) in the where statement?
Have you tried Stefan's script? It isn't working?
Sunny,
I just tried the same in original req. it didn't work.
Sorry for the confusion
Stefan,
It is not working. Let me put the result what i'm seeing.
To make my script work, you shouldn't load SKU field before running my table load.
I think you know how exists() work? Checking an input value against a symbol table containing all field values encountered so far in your load script run?