Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Qlikview peek function is working fine in the version 12.10.20600.0 but it seems that it is not working as per the exceptation on the version 12.40.20400.0.
It is returning more than 1 record.
Could you please suggest on this?
Also the comparison variables are not working without num function.
Below is the snapshot for the error in the Qlikview version 12.40.20400.0,
Thanks
The right aligning from the values of both list-boxes shows that they are treated as numeric values. But the field-values are different - like already above hinted is one a formatted timestamp and one an none formatted date.
This means your script and/or data are definitely not identically between both releases. Therefore I repeat my suggestion from above to check the whole data/load-chain systematically.
- Marcus
Hi All,
Is there any suggestion on this.
Below is the snapshot for the error,
I assume that your error isn't related to peek() else to the content which you fetch with it or to the way how it's later interpreted. This means your dates aren't dates anymore else strings and/or their format has changed in any way.
You may apply something like:
TRACE $(vBD);
below the peek-statements to see within the progress-window or within the document-log which content is really there.
- Marcus
Hi Marcus,
Can you please have a look at the below code?
Loop1:
LOAD Distinct
//ACCT_SYSTEM_PORTF_NO_PERF as PortLoop,
ANALYSIS_DATE as AnLoop,
BUSINESS_DATE_PERF as BDLoop
Resident PERF_TEMP Order By BUSINESS_DATE_PERF,ANALYSIS_DATE; // MonthNo>='$(vMaxMonth60)' and ACCT_SYSTEM_PORTF_NO_PERF,
let numRow= NoOfRows('Loop1');
sub Loop2
FOR i=0 to ('$(numRow)'-1);
//let vPort=peek('PortLoop',$(i),'Loop1');
let vBD=peek('BDLoop',$(i),'Loop1');
let vAD=peek('AnLoop',$(i),'Loop1');
if len('$(vAD)')=0 then
EXIT Sub;
ELSE
//
MaxLoop:
LOAD ACCT_SYSTEM_PORTF_NO_PERF,
$(vAD) as ANALYSIS_DATE,
BUSINESS_DATE_PERF,
max([Comp PF Return]) as MaxCompPF,
max([Comp BM Return]) as MaxCompBM,
max([Comp Active Return]) as MaxCompAct
Resident PERF_TEMP Where ANALYSIS_DATE<=$(vAD) and BUSINESS_DATE_PERF='$(vBD)' Group By ACCT_SYSTEM_PORTF_NO_PERF,BUSINESS_DATE_PERF; //and ACCT_SYSTEM_PORTF_NO_PERF='$(vPort)'
ML1:
LOAD ACCT_SYSTEM_PORTF_NO_PERF,
ANALYSIS_DATE,
BUSINESS_DATE_PERF,
[Comp PF Return],
[Comp BM Return],
[Comp Active Return]
Resident PERF_TEMP Where ANALYSIS_DATE=$(vAD) and BUSINESS_DATE_PERF='$(vBD)';//and ACCT_SYSTEM_PORTF_NO_PERF='$(vPort)
Left Join (ML1) LOAD * Resident MaxLoop;
DROP Table MaxLoop;
The code is working fine in QV version 12.1 but not working in QV version 12.4 and we have a same data sets.
When I tried num with Peek it return it is not functioning properly.
could you please assist me?
Thanks
In general there was no change on logic and syntax and therefore it should further work. Therefore I assume that the included data respectively their interpreting have changed. The interpretation depends on the interpretation-variables at the beginning of the script respectively if they aren't specified on the OS regional settings. Also the load-order could have an impact.
Because of the fact that you mentioned that num(peek()) returned not a value hints that peek() returned a string-value which couldn't num() to format. This might be solved within the variable-assigning with num#() which could convert a string but IMO better would be if you check the data and their interpretation already by loading them before you decide in which way you adjust it. I wouldn't try to check such things within a loop-logic else just loading the data in tables within the UI. Beside any formatting the value-typ of numeric or string is easily visible within the right/left aligning of the values.
- Marcus
Hi Marcus,
I think there are changes in the interpretation variables. But we have created the new app so it should be as per the system defined format and there no manual changes from our side.
At the start of the script,
Below are the snaps for the two apps,
12.1 (Where the script runs successfully)
12.4(where script fails)
But I don't know but nothing is working.
Thanks
The interpretation-variables for dates look equally between both releases. How does it look like if you loads the data directly without any loop or clauses like above mentioned. Any differences between the releases?
- Marcus
Hi Marcus,
Without any loop, there are no issues. But with loops it is throwing an error as mentioned above.
Apart from this, if I can run the data model layer as it is by using the already created QVd in 12.1 in that case also my results are not matching.
This is weird and the most pressing issue. Unfortunately, on the web there is no available information related to this.
Thanks
Take a look within the document-log. Is the loop running at least once? Where did it break? How are the various variables evaluated until it breaks?
- Marcus
Hi Marcus,
PFA document log.
Thanks