Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to get the corresponding column value of one row. I have this table:
Table_Prod_Category
Prod_Id ProdName CatgName
1 ABC New
2 XYZ Old
Load
Prod_Id, Dual(ProdName,CatgName) as DualProd
from Table_Prod_Category;
I have one list box of "DualProd" Now I want in textbox the Selected value of list box(Only CatgName, not ProdName).
Please help me how to get second value from dual.
Regards
Jas
I don't think you can. The second argument of the dual function should be a number. If it was you could get it with num(DualProd), but since 'New' and 'Old' aren't numbers it won't return a result. What's wrong with setting the text box to =CatgName? That will show the CatgName of the ProdName you select as long as there's only one CatgName per product.
HI
dual( s , x )
Forced association of an arbitrary string representation s with a given number representation x. In QlikView, when several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered. The dual function is typically used early in the script, before other data is read into the field concerned, in order to create that first string representation, which will be shown in list boxes etc.
Example:
load dual ( string,numrep ) as DayOfWeek inline
[ string,numrep
Monday,0
Tuesday,1
Wednesday,2
Thursday,3
Friday,4
Saturday,5
Sunday,6 ];
load Date, weekday(Date) as DayOfWeek from afile.csv;
The script example will generate a field DayOfWeek with the weekdays written in clear text. QlikView will for all purposes regard the field as a numeric field.
Note:
From help, you can noted that, you can't able to represents both as string value in dual() fuction
Hope it helps
Thanks Gysbert and Mayil,
My Concern is to get multiple category name when user select Multiple Prod Name, or understand it as User working on "Description" to select something and I want to work on code which is alphanumeric in background. The other solution could be to be concatenate(prodName&'|'&CatgName) them and while showing in list box I take Left from "|" symbol and then when user select multiple items then I will get all by two separator, first with "|" separator and then other with"," delimeter those which are mutli selected.
If could use string, string in dual and can retrieve that in getfieldselection then it will be easy.
Thanks
Jas
HI
Try like this, may be it helps
Load Prod_Id,ProdName,CatgName,ProdName&' '&CatgName as Key from table;
Then use key field to display..
Hope it helps
Thanks again guys,
In My solution User has 5 choice, he can select 1,2 ..5 Now if user select 1 then I want to show different expression and if chooses 2 then different expression. if user selected two then show all expression for two. but user has option to select a "long description" which I can not use to compare in expression but I have one more associate code which is alphanumeric. So this is the scenario. its simple to use by concat but I am trying to get some good alternative and also enhance my knowledge on dual.
Thanks
Jas