Discussion Board for collaboration on QlikView Scripting.
What I am trying to achieve is to wildcard match from all loaded fields and select those which have particular value. This matched fields will have only one value assigned all the time.
my script will bring you closer to what I want to do, but its obviously not working
let maskedCount = 1;
for Each maskedField in WildMatch([$Field],'mask_*')
if Num(maskedField) <> -1 then
let $maskedCount = $maskedCount + 1;
can you, please, show me an elegant way to do this?
Thank you all!
I think you need another approach with table- and field-functions - $Field isn't available in script. See here a small example to count fields:
for i = 0 to NoOfTables() - 1
for ii = 1 to NoOfFields(TableName($(i)))
let vTableName = '[' & TableName($(i)) & ']';
let vFieldName = '[' & FieldName($(ii), TableName($(i))) & ']';
for j = 0 to NoOfTables() - 1
for jj = 1 to NoOfFields(TableName($(j)))
let vFieldNameCounter = '[' & FieldName($(jj), TableName($(j))) & ']';
let vFieldCounter = if('$(vFieldName)' = '$(vFieldNameCounter)', 1 + $(vFieldCounter), $(vFieldCounter));
Hi Marek, there is no $Field field in the script level. Please go with what Marcus suggested.
thank you, guys! actually, it was easier for me cause I have to iterate through one table only...