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: 
carolin01
Partner - Creator II
Partner - Creator II

Set Analysis

Hi,

Could anybody help me to correct my variable:

vRevenueTotalMax = sum({$<FYear = {$(=Max(FYear))}, OrderPhase_Desc = {Revenue}>} NettAmount$(vCurrency));

I would like to see the Revenue for the Maximum Year that I choose from a List box. But it´s not calculating anything.

It´s for sure something about brackets etc or similar...

Many thanks for your comments.

Best regards

Carolin

20 Replies
carolin01
Partner - Creator II
Partner - Creator II
Author

Hello together,

Many thanks for all of your help. All answers were helpful but I contacted our consultant in the meantime and got a solution. As you might be interested I post it here:

Possibility 1:

vRevenueTotalMax = 'sum({$<FYear ={' & chr(36) & '(=Max(FYear))}, OrderPhase_Desc = {''Revenue''}>} NettAmount$(vCurrency))';

Possibility 2: 

let vRevenueTotalMax = 'sum({$<FYear ={' & chr(36) & '(=Max(FYear))}, OrderPhase_Desc = {' & chr(39) & 'Revenue' & chr(39) & '}>} NettAmount$(vCurrency))';

The reason seemed to be that for some reason inspite of the set statement Qlik View calculated the formula directly when running the script. This always caused an "internal error". So the solution was to use a let statement instead and link the part with "&" as you can see from above. Now I´m able to maintain these formulas in the script and use it for several charts.

Many thanks once more for all of your kind help.

Best regards,

Carolin