Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement in load script

Hi,

can anyone help with this error message i keep receiving? I can't seem to figure out what the problem is.

Error in expression:

')' expected

The problem occurs during the execution of the following code:

//Vastgoed kenmerken

VGKenmerken:

LOAD VHE_ID,

     VHE_EPA AS [Energielabel],

     IF (CV='J', 'CV', 'HR') AS [Verwarmingseenheid],

     IF(Coll='J', 'JA','Nee') AS [Collectief],

     IF(Meter='J', 'Ja', 'Nee') AS [Meter]

       

FROM

(ooxml, embedded labels, table is [Actueel bezit]);

//Huurprijzen

Join (VGKenmerken)

LOAD VHE_ID,

     Jaar,

     HP_NETTOHUUR AS [Nettohuur_historisch],

     HP_MAXHUUR AS [Maximumhuur_historisch],

    if(VHE_EPA='A',(SUM(HP_MAXHUUR)*$(Streefnorm_A)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='B',(SUM(HP_MAXHUUR)*$(Streefnorm_B)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='C',(SUM(HP_MAXHUUR)*$(Streefnorm_C)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='D',(SUM(HP_MAXHUUR)*$(Streefnorm_D)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='E',(SUM(HP_MAXHUUR)*$(Streefnorm_E)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='F',(SUM(HP_MAXHUUR)*$(Streefnorm_F)-SUM(HP_NETTOHUUR)),

    if(VHE_EPA='G',(SUM(HP_MAXHUUR)*$(Streefnorm_G)-SUM(HP_NETTOHUUR)), (SUM(HP_MAXHUUR)*$(Streefnorm_overige) -SUM(HP_NETTOHUUR))

    ))))))) AS [Meerwaarde]   

     FROM

 

     FROM

(ooxml, embedded labels, table is [Rapport 1]);

13 Replies
anbu1984
Master III
Master III

Load VHE_ID,Jaar,

[Nettohuur_historisch],[Maximumhuur_historisch]

Sum(if(VHE_EPA='A',((HP_MAXHUUR)*$(Streefnorm_A)-(HP_NETTOHUUR)),

    if(VHE_EPA='B',((HP_MAXHUUR)*$(Streefnorm_B)-(HP_NETTOHUUR)),

    if(VHE_EPA='C',((HP_MAXHUUR)*$(Streefnorm_C)-(HP_NETTOHUUR)),

    if(VHE_EPA='D',((HP_MAXHUUR)*$(Streefnorm_D)-(HP_NETTOHUUR)),

    if(VHE_EPA='E',((HP_MAXHUUR)*$(Streefnorm_E)-(HP_NETTOHUUR)),

    if(VHE_EPA='F',((HP_MAXHUUR)*$(Streefnorm_F)-(HP_NETTOHUUR)),

    if(VHE_EPA='G',((HP_MAXHUUR)*$(Streefnorm_G)-(HP_NETTOHUUR)), ((HP_MAXHUUR)*$(Streefnorm_overige) -(HP_NETTOHUUR))

    )))))))) AS [Meerwaarde] Resident VGKenmerken Group by VHE_ID,Jaar,[Nettohuur_historisch],[Maximumhuur_historisch];

Not applicable
Author

Yeah figured out that the problem was the names, got the same script as you provided. Got the error:

Error in expression:

')' expected

again....

Not applicable
Author

Also tried this:

Load VHE_ID,Jaar,[Nettohuur_historisch],[Maximumhuur_historisch],

Sum(if([Energielabel]='A',([Maximumhuur_historisch]*$(Streefnorm_A)-[Nettohuur_historisch]),

    if([Energielabel]='B',([Maximumhuur_historisch]*$(Streefnorm_B)-[Nettohuur_historisch]),

    if([Energielabel]='C',([Maximumhuur_historisch]*$(Streefnorm_C)-[Nettohuur_historisch]),

    if([Energielabel]='D',([Maximumhuur_historisch]*$(Streefnorm_D)-[Nettohuur_historisch]),

    if([Energielabel]='E',([Maximumhuur_historisch]*$(Streefnorm_E)-[Nettohuur_historisch]),

    if([Energielabel]='F',([Maximumhuur_historisch]*$(Streefnorm_F)-[Nettohuur_historisch]),

    if([Energielabel]='G',([Maximumhuur_historisch]*$(Streefnorm_G)-[Nettohuur_historisch]), ([Maximumhuur_historisch]*$(Streefnorm_overige) -[Nettohuur_historisch])

    )))))))) AS [Meerwaarde] Resident VGKenmerken Group by VHE_ID,Jaar,[Nettohuur_historisch],[Maximumhuur_historisch];

anbu1984
Master III
Master III

Can you attach sample input files.