Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have 5 fields in a table, those are field1, field2, field3, field4, field5 these are loaded in a order 1st column, 2nd column, 3rd column like that
for example :
i want to create a variable vf1= if(sum(1stcolumn) > sum(2nd cloumn),1,0)
actual vf1=if(sum(field1)>sum(field2),1,0) like that if i change the above condition 3rd column ,4th column
dynamically it has to take the values field3 and field4 how can i acheive this
i don't understand your requirement. Do you want to create a collection of variables? What does "actual" mean here? What do you mean by changing the condition dynamically?
I suggest that you post a small sample document with some representative data and the table in question and a clear description of what you need with specific examples.
in above example vf1= if(sum(1stcolumn) > sum(2nd cloumn),1,0)
1st column means first field name in the table
2nd column means second field name in the table
if i have A,B,C,D are fields
A=first field
B=second Field like that
vf1= if(sum(1stcolumn) > sum(2nd cloumn),1,0)
A B
vf1= if(sum(2ndcolumn) > sum(3rd cloumn),1,0)
B C
like that field names need to change dynamically based on 2nd column 3rd column fourth column like that
May be you need parameterized variable (Qlikview Parameterised Variables). Try defining your variable like:
vf1 = if(sum($1) > sum($2),1,0)
and then pass field names while expanding the variable like:
$(vf1(Field2, Field3)) // you can change field names as and when required while calling it.
in future it may increase the fields A,B,C,D,E like that but it has to take first column means A only last column means the updated value
but i want to change dynamically without doing this
$(vf1(Field2, Field3)) // you can change field names as and when required while calling it.
dont want to change field names dynamically it has to take the updated values
Try this...
For i = 1 to NoOfRows('Table')
set name = 'Dim$(i)';
set '$(name)' = 'expression';
Next i