Discussion Board for collaboration on QlikView Scripting.
I'm working now with creating variable which will be used as IF statement in next load.
What is the idea?
I have simple table like:
what i need - create if statement with checking all ID_Cond values and corresponded Condition to set necessary Category, for example:
IF(ID=1 and Name='A', 'First',
IF(ID=2 and Name='B', 'Second',
... , 'non'))
I started to create this variable in loop, but stopped with appending to if statement in the loop (see example in the attachment).
Any idea how to correctly create this statement?
In result my variable should have this value:
'IF([ID_Cond]='1' and ([Name]='A'), 'First',
IF([ID_Cond]='2' and ([Name]='B'), 'Second',
IF([ID_Cond]='3' and ([Name]='C'), 'Third', 'Non') as NewField;'
what you can do is reload your table.
IF([ID_Cond]='1' and ([Name]='A'), 'First',
IF([ID_Cond]='3' and ([Name]='C'), 'Third', 'Non'))) as NewField
drop table Table1; rename table Table2 to Table;
then you'll have a Table with the fields ID_Cond, Name and NewField.
i hope I helped you.