OK, that won't work because you can't do a sum without grouping in a load statement, you should remember that you are loading one row at a time. Perhaps what you need to do is explain what you want to achieve rather than trying to explain part of the solution and part of the requirement. Questions: 1. In the VAT_REGEX table you are going to create rows of data where you will have a field called AT_VAT and another field called BE_VAT, those fields will contain a 0 or a 1, what is the business purpose or meaning of those fields 2. In the VAT_CHECK table you are creating one more field, this one called TOTAL (I'd recommend renaming that as TOTAL is also a keyword in QlikView), bearing in mind that this is a transactional table with only one country defined per row, this field will only ever hold a value of 1 or 0, so I'd be interested to know the purpose of this too 3. If this really is what you want then the TOTAL field should actually just be defined as IF(AT_VAT=1 OR BE_VAT=1,1) AS TOTAL (i.e. remove the SUM from this) 4. Also be aware the if you already have CUSTOMER_TEST as a table then you have VAT_REGEX and then VAT_CHECK and all of these tables have COUNTRY and VAT_REGIST fields, you're going to end up with a circular reference Hope this helps
Looking at this again, are you simply trying to find on a line by line basis if the VAT Registration number is formatted correctly? And on the other side, you want to know how many rows of data you have in the table where the VAT number is formatted incorrectly? Is this correct?
"Looking at this again, are you simply trying to find on a line by line basis if the VAT Registration number is formatted correctly? And on the other side, you want to know how many rows of data you have in the table where the VAT number is formatted incorrectly? Is this correct?"
Yes, it's exactly the purpose of my script!
So, do you think that it's wrong to take this problem in two steps:
1/ First table: Define all my statement with the structure of the VAT
2/ Second table: Count the number of rows which are not conform to the structure defined in the first step.