Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to use ApplyMap by the FieldName, to some fields.
For example:
ApplyMap('Map_FieldCode', FieldName(nr ,'TableName'))
Is it possible?
I thought of using a loop, but something is going wrong while trying to create the new table.
OpenPurchOrder:
LOAD Distinct PurchOrder_LineID,
PurchOrder_Line_DepartDate,
PurchOrder_Line_SupplyDate,
from $(vQVDPath)PurchOrder.QVD (qvd)
Where PurchOrder_Flag_IsClosed =0;
LET NF = NoOfFields('OpenPurchOrder');
LET NR = NoOfRows('OpenPurchOrder');
FOR I = 1 TO $(NR)
FOR J = 1 to $(NF)
TmpTable:
LOAD FieldName($(J),'OpenPurchOrder');
NEXT
NEXT
Thanks!
Hi Dafnis,
can you explain what are you trying to accomplish, in simple words? Are you mapping field names or field values? how does your mapping table look like?
Cheers,
Oleg Troyansky
Upgrade your Qlik skills at the Masters Summit for Qlik - coming to Boston, MA this October!
Hi Oleg,
I'm trying to map a value by the QVD field name:
QVD_FieldName | Metric_Code |
PurchOrder_Line_DepartDate | 2 |
PurchOrder_Line_SupplyDate | 3 |
PurchOrder_Line_Flag_SuppDateIsConf | 4 |
Thank you!
Sorry, still missing the point... Maybe if you describe your source data and the desired result, it could become clearer...
Yes, I realize that...
This is the base table:
OpenPurchOrder:
LOAD Distinct PurchOrder_LineID,
PurchOrder_Line_DepartDate,
PurchOrder_Line_SupplyDate,
from $(vQVDPath)PurchOrder.QVD (qvd)
Where PurchOrder_Flag_IsClosed =0;
I would like to link metric code to some of the fields.
The mapping is based on the field name.
Otherwise, i have to write it in the script:
For example:
.......
Concatenate (MissingDates)
LOAD PurchOrder_LineID as Tmp_LineID,
PurchOrder_No as Tmp_PurchOrder_No,
2 as Tmp_MetricCode
Resident OpenPurchOrders
Where Year(PurchOrder_Line_DepartDate) =1988;
Concatenate (MissingDates)
LOAD PurchOrder_LineID as Tmp_LineID,
PurchOrder_No as Tmp_PurchOrder_No,
3 as Tmp_MetricCode,
Resident OpenPurchOrders
Where Year(PurchOrder_Line_SupplyDate) =1988;
You can try something like the below
Let vMetriccode = '1,2,3';
LOAD PurchOrder_LineID as Tmp_LineID,
PurchOrder_No as Tmp_PurchOrder_No,
subfield('$(vMetriccode)',',') as Tmp_MetricCode
Resident OpenPurchOrders
Where Year(PurchOrder_Line_DepartDate) =1988;
And then use applymap on Tmp_MetricCode
Hi,
Sorry for my late response...
Please note that for each metric I check another field (DepartDate, SuppluDate, etc..)
So i'm not sure how i should apply your solution.
Thank You!