Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

priyarane
Valued Contributor

Hard Code value in Expression

Hi Community,

I am hardcoding value in the expression and once I select on the particular value my value is coming as default

For Ex:

If(Country = 'IND',

Sum(Sales)

+

$(=Sume({<Country = {'Afr','Den'}>}Exp))

,

Sum(Sales)

)

above expression is working as expected

for Ex

for IND, I am getting 100+50 = 150

but once I select on 150 then it is coming as 100

the above situation should be avoid as I am expecting as 150

Please help.

_Priya

7 Replies

Re: Hard Code value in Expression

Selecting on 150? Why are you selecting on the expression value?

priyarane
Valued Contributor

Re: Hard Code value in Expression

Users will test other reports for drilldown option

Partner
Partner

Re: Hard Code value in Expression

Hi,

Your if clause says the same, it works in the way you have written the if condition. If country = Ind, then 100 (Ind sales) + 50 (Afr Sales + Den Sales), but in the else part you mentioned only 100.

Please explain with some sample data.

Thanks,

Shan S

priyarane
Valued Contributor

Re: Hard Code value in Expression

else part is not 100 it is sales, 100 is for only IND

Partner
Partner

Re: Hard Code value in Expression

Yes but as per your expression if the country selected is IND the 100 + 50 else its just sum(sales) which means the country which the user is drill down into, correct?

Thanks,

Shan S

priyarane
Valued Contributor

Re: Hard Code value in Expression

country     Expr

AFr           20

IND           150

Den          50

US            10

so here user can select on values from Expr

Partner
Partner

Re: Hard Code value in Expression

Yes, so here when user selects 150 then the dimension is filtered to 'IND'. so in your expression you have to ignore the country selection in the amendment part (i.e., the second part after + in your if part).


If not clear, just give a sample QVW with your expression I will try and let you know.


Thanks,

Shan S