I have an associated problem: I have a complicated cashflow calculation where all the values have two versions, one basic and one including Skonto (rebate), named like this:
[Cash in from Customers]
[Cash in from Customers_Skonto]
In charts I want to give the user the choice between the two value-versions, so I set up a variable vSkonto, which can be either empty or '_Skonto', by user-button-click.
The sum should look something like: sum([Cash in from Customers$(vSkonto)])
so that the user can control which fieldname is used. The problem is: I can't get it to work syntaxwise. I tried in and out of brackets, with and without quotes - can't you do it that way at all, or am I missing a trick?
I know I could do it with an if-statement, but the formulas are already convoluted if-statements, so I'd prefer not to have to add another layer.
It would be really great if you could help me,
this is one long thread, you might be better off opening a new one...
Anyway, I treid your expression, and it seems to work. I suspect you might have a syntax issue - perhaps an extra space or something like that... See attached sample
spasibo bolshoe, you just saved me from a lot of extra coding!
It was indeed a syntax problem - when I set the variable, I used quotes, which QV then included in the variable (even though it didn't show them when I checked the variable in a textbox).
I read your answer and tried the solution that you gave but it does not work.
I have a variable named "vBucket" which is defined as :-
if(($(vPercentage))> 0 and ($(vPercentage))<=25 ,'0-25',
if(($(vPercentage))> 25 and ($(vPercentage))<=50 ,'26-50',
if(($(vPercentage))> 50 and ($(vPercentage))<=75 ,'51-75',
if(($(vPercentage))> 75 and ($(vPercentage))<=100 ,'76-100','Above 100'))))
Now the "vBucket" variable works perfectly fine in textbox but not in the pivot table as a dimension.
I tried "=[$(vBucket)]" but it fails and shows "-"
U have downloaded your qvw file and pasted in user/documents/qlik/sense/apps. It got converted to .qvf file but I am not able to see the app overview. I can see data manager view and data load editor view but cannot see app where I want to test your scenario of cyclic dimension. Please help