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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple records

As you can see in the attached file, i load some data from an excel file

Then i check if the field [codice agevolazione] is equal to some determined values, and in that case i use some variable to set a new field [aliquota stato]:

if([codice agevolazione] = 'A0100', '$(vAliqStatoA0100)',

if([codice agevolazione] = 'A0160', '$(vAliqStatoA0160)',

if([codice agevolazione] = 'B0210', '$(vAliqStatoB0210)',

if([codice agevolazione] = 'E0100', '$(vAliqStatoE0100)',

if([codice agevolazione] = 'H0100', '$(vAliqStatoH0100)',

if([codice agevolazione] = 'L0100', '$(vAliqStatoL0100)',

if([codice agevolazione] = 'L0110', '$(vAliqStatoL0110)',

if([codice agevolazione] = 'R0100', '$(vAliqStatoR0100)',

if([codice agevolazione] = 'A0000', '$(vAliqStatoA0000)',))))))))) as [aliquota stato]

When i run the script i get multiple rows for each original row, as if QV found more than one value in the [codice agevolazione] field

This is completely unexpected, and i cannot understand why it works this way

Any idea?

1 Solution

Accepted Solutions
Not applicable
Author

Do those variables have values? Since the new result is the expression to display a variable, if the variable is blank it will return nothing.

You can try setting one of the variables to see what it does.

Edit:

I just looked at your file, try linking this table to the original. It seems to be creating multiple records due to there not being a direct link, so for every line from the main table you get it multiplied by the total lines from the resident table.

I also have no experience working with Replace loads or partial reload functions so I may be completely off.

View solution in original post

3 Replies
Not applicable
Author

Have you tried this?

'$(vAliqStato' & [codice agevolazione] & ')' as [aliquota stato]

Not applicable
Author

tried now, without success (i get blank as result for [aliquota stato])

Not applicable
Author

Do those variables have values? Since the new result is the expression to display a variable, if the variable is blank it will return nothing.

You can try setting one of the variables to see what it does.

Edit:

I just looked at your file, try linking this table to the original. It seems to be creating multiple records due to there not being a direct link, so for every line from the main table you get it multiplied by the total lines from the resident table.

I also have no experience working with Replace loads or partial reload functions so I may be completely off.