Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
Is it possible to use the variable in the if condition like this
=If (Value='$(vName)', Result)
Hi Again,
Now I understand what you mean (hopefully!). In my example, if you wanted to see all the Sales values for vTest variable then you need to use Concat function with Set Expression. However in your dataset if you have one-one relationship between the two fields then you can use ONLY function or any aggregation function.
Concat({<Months = {$(vTest)}>} Sales, ', ')
or
ONLY({<Months = {$(vTest)}>} Sales)
I'm attaching the updated QVW file. I hope this helps!
Cheers - DV
Yes, you can use it. If you have expression in the variable then you can use the dollar sign expansion. If not, you can use :
=If (Value = vName, Result)
I'm assuming that "Value" is the field name in the above example.
Cheers - DV
Yes it is the field value
But does the Value column should have a default selected value ?
Hi Again,
Okay. What does the variable contain? Have you tried the above solution? Please post the sample QV document if you still have issues.
Answering your second question : It doesn't need to be default selction however, if you wanted to execute the condition based on field selection then you can use meta data functions in QlikView. I had made a video tutorial explaining more about meta data functions in QlikView. Here is the link :
Thanks,
DV
I tried it if the value is selected then it is working fine else it is not. File size is huge . i need to scrample it.It will take a lot of time. If you place some example it would be great.
Okay, so you don't want to make selection but you wanted to check if the condition evaluates true or false. Is this right?
Thanks - DV
If you need to check the field values hold the contents of variable as a condition without making a selection then you need something like this...
=IF(Concat(Value, ', ') like '*$(vName)*', Result)
I'm using the like operator with wild card - (*) to search if the variable contents exists within your Value field.
I hope this makes sense.
Cheers - DV
OK let me check , Result field is also a column name.Not the hardcoded value.
Hi Again,
I'm not sure if you wanted to display the "Result" field in TextBox or ListBox. However, I have created a sample QVW file for your reference. Please check the two variable I have used in the example. They are vTest and vCondition and please let me know if you have any questions.
Good luck!
Cheers - DV