Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

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
sunny_talwar

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

priyarane
Specialist
Specialist
Author

Users will test other reports for drilldown option

shansundar
Partner - Creator
Partner - Creator

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
Specialist
Specialist
Author

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

shansundar
Partner - Creator
Partner - Creator

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
Specialist
Specialist
Author

country     Expr

AFr           20

IND           150

Den          50

US            10

so here user can select on values from Expr

shansundar
Partner - Creator
Partner - Creator

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