Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

help script fieldvalue and peek

Hello,

i have this table in mysql

id_reqreq_nameid_req_parent
1Recette référentiel0
2Documentation projet1
3Maintenance1
4SGDT1
5Recette exploitablilité0
6Supervision5
7Sauvegardes5
8Test a/r et de rupture5
9Recette interne0
10Recette référentiel0
11Recette exploitablilité0
12Recette interne0
13Documentation projet10
14Maintenance10
15SGDT10
16Supervision11
17Sauvegardes11
18Test a/r et de rupture11
19Recette référentiel0
20Recette exploitablilité0
21Recette interne0
22Documentation projet19
23Maintenance19
24SGDT19


I do this in excel, i computed EXIGENCE MERE in excel with this formule

=SI(D2=0;C2;RECHERCHEV(D2;A:D;3;FAUX))

id_reqEXIGENCE MEREreq_nameid_req_parent
1Recette référentielRecette référentiel0
2Recette référentielDocumentation projet1
3Recette référentielMaintenance1
4Recette référentielSGDT1
5Recette exploitablilitéRecette exploitablilité0
6Recette exploitablilitéSupervision5
7Recette exploitablilitéSauvegardes5
8Recette exploitablilitéTest a/r et de rupture5
9Recette interneRecette interne0
10Recette référentielRecette référentiel0
11Recette exploitablilitéRecette exploitablilité0
12Recette interneRecette interne0
13Recette référentielDocumentation projet10
14Recette référentielMaintenance10
15Recette référentielSGDT10
16Recette exploitablilitéSupervision11
17Recette exploitablilitéSauvegardes11
18Recette exploitablilitéTest a/r et de rupture11
19Recette référentielRecette référentiel0
20Recette exploitablilitéRecette exploitablilité0
21Recette interneRecette interne0
22Recette référentielDocumentation projet19
23Recette référentielMaintenance19
24Recette référentielSGDT19


How can i do this in qlikview script?

i try to use this but i have an error message ") expected"

if(fieldvalue('id_req_parent',1)=0,[req_name] AS [EXIGENCE MERE],peek([req_name],fieldvalue('id_req_parent',1)) AS [EXIGENCE MERE]),*;

2 Replies
Not applicable
Author

Try it Geeked

if(fieldvalue('id_req_parent',1)=0,[req_name] ,peek([req_name],fieldvalue('id_req_parent',1)) ) AS [EXIGENCE MERE]

Daniela

PS: can you attach the example

Not applicable
Author

thanks a lot

the error message disappear but my table EXIGENCE MERE is empty

i think is because fieldvalue('id_req_parent',1) is empty in my previous example i would like have 0 for the first result etc...

my script is may i have to use a "loop" or "for" to parse the table and compute all "EXIGENCE MERE"?





LOAD

cat

,

complexe

,

`id_project`

,

`id_req`

,

`id_req_parent`

,

origine

,

priority

,

reference

,

`req_description`

,

`req_name`

AS [exigence]

,

if

(fieldvalue('id_req_parent',1)=0,[req_name] ,peek([req_name],fieldvalue('id_req_parent',1)) ) AS [EXIGENCE MERE]

,

`req_type`

,

state

,

verif

,

version;

SQL

SELECT

cat,

complexe,

`id_project`,

`id_req`,

`id_req_parent`,

origine,

priority,

reference,

`req_description`,

`req_name`,

`req_type`,

state,

verif,

version



FROM

`salome_pp_bdd`.REQUIREMENTS;