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: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

variable help

Hi Everyone,

I have the foloowing variable..

LET vTargetSum_DistributionChart =

'avg({1<

        [it_target_type]={"Distribution"},

        it_objective_name={'&CHR(36)&'(v_it_objective_name_selections)},

        territory_region={'&CHR(36)&'(v_territory_region_selections)},

       JOIN_territory={'&CHR(36)&'(v_JOIN_territory_selections)}

>}

       [it_target_value]

)';

I want to add in some logic but un sure on how to do it.

basically if the result of the above is NULL then i want to show it as 0.

Can anyone help on how to incorporate this into the above variable please?

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try using the alt function:

LET vTargetSum_DistributionChart =

'alt(avg({1<

        [it_target_type]={"Distribution"},

        it_objective_name={'&CHR(36)&'(v_it_objective_name_selections)},

        territory_region={'&CHR(36)&'(v_territory_region_selections)},

       JOIN_territory={'&CHR(36)&'(v_JOIN_territory_selections)}

>}

       [it_target_value]

),0)';


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try using the alt function:

LET vTargetSum_DistributionChart =

'alt(avg({1<

        [it_target_type]={"Distribution"},

        it_objective_name={'&CHR(36)&'(v_it_objective_name_selections)},

        territory_region={'&CHR(36)&'(v_territory_region_selections)},

       JOIN_territory={'&CHR(36)&'(v_JOIN_territory_selections)}

>}

       [it_target_value]

),0)';


talk is cheap, supply exceeds demand