Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am loading 2 qvds with Targets ( same data structure, only different dates) and my problem is, when I load the qvds (Targets_07092017 and Targets_06092017), the preceding load with the mapping is generating two tables instead of one,
my first table is than named "Targets" and have the Name mapped to the Targets, and the second table (which should not be there) is named "Targets_07092017", there the mapped Name is missing.
If I am commenting the mapping table and the preceding load out, everything works fine...
Does anybody know how to fix this?
Thanks for your help, Chris
MapTOP_NametoTargets:
Mapping Load
Distinct [Customer Code],
Name
Resident fact_table_tmp;
Targets:
LOAD *,
applymap('MapTOP_NametoTargets',[Customer Code],null()) as Name ;
LOAD
[Customer Code],
From,
To,
Target,
Time_Stamp
FROM
[$(vG.QVDPath)Targets_*.qvd]
(qvd) where Time_Stamp>=$(vL.Date_Border)
;
Look at HIC's response here:
https://community.qlik.com/blogs/qlikviewdesignblog/2013/03/04/preceding-load#comment-7069
There is a bug where WildCard load doesn't behave nicely with the preceding load and creates multiple tables.
Why not try this instead preceding load
MapTOP_NametoTargets:
Mapping Load
Distinct [Customer Code],
Name
Resident fact_table_tmp;
Targets:
LOAD
[Customer Code],
From,
To,
Target,
Time_Stamp,
applymap('MapTOP_NametoTargets',[Customer Code],null()) as Name
FROM
[$(vG.QVDPath)Targets_*.qvd]
(qvd) where Time_Stamp>=$(vL.Date_Border)
Look at HIC's response here:
https://community.qlik.com/blogs/qlikviewdesignblog/2013/03/04/preceding-load#comment-7069
There is a bug where WildCard load doesn't behave nicely with the preceding load and creates multiple tables.
Hi Chris,
Kindly take the resident of your Target table and use Applymap() in that resident table.
Preceding load evaluates your both the tables separately and thus mapping only one table data.
Kindly find attached sample qvw
Regards
Sumeet Vaidya
Thank you, I used the Resident Load Version which solves my issue.
Although I think, Sunnys post is the original problem including the solution:
"Instead a use a For-Next loop should be used:
For each vFile in FileList('C:\path\*.txt')
Load ... From [$(vFile)] ;
Next vFile
Which is identical to
Load ... From
And within the For-Next loop you can put as many Preceding Loads as you wish..." from HIC.
Thanks Sunny, I guess this mentioned solution from HIC is the fastest one concerning calculation time. For time matter I used a Resident Load but I am already thinking about re-writing my code. Thank you, again!