Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community!
In the load script I want to set values to a field that in the qvd file has no value. This is so I can load only these fields, and furthermore, use them in calculations.
My database is a qvd file.
Example:
Lets say this qvd file contains the columns Store - Item - Customer - Broken like in the table below.
If the item is broken the value in the field Broken is set to B.
If the item is not broken, the field is empty.
When I load the script the missing value in these empty fields is shown like a hyphen - (since its empty)
In the database which is the basis for the qvd file, this fields are only filled if the item is Broken.
The B field records is not necessary to load as I am only interested in loading the records for the empty field values.
The empty field values should be given a string, e.g U (for Unbroken) in the script. This applies to all empty fields in that column.
Store | Item | Customer | Broken |
---|---|---|---|
ABC Store | Work Bag | Mickey Mouse | - |
DEF Store | Handbag | Dolly Duck | B |
ABC Store | Handbag | Donald Duck | - |
GHI Store | Suitcase | Pluto | - |
GHI Store | Work Bag | Mickey Mouse | B |
I think you could use:
if(len(trim(Broken))=0, 'ok.', Broken) as broken
- Marcus
I think you could use:
if(len(trim(Broken))=0, 'ok.', Broken) as broken
- Marcus
Hi Marcus,
Thank you
Could you please describe what len and trim does?
Just so I understand what I have done 😉
Regards
Nina
Len() counts the number of chars within a fieldvalue and trim() removed possible leading and ending spaces and it's combination it's similar to isnull() but it extend the logic to fieldvalues like '' or ' ' which are strictly spoken not NULL but contain not a real respectively useful value.
- Marcus