Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Resolving Expression : Variable & text string

Hello,

I have declared variable as part of my script. It assigns value based upon month.

So, if Current_month = 'April' ,  variable will be "vMonth1_Revenue'. (Field has revenue for month of April). It loads fine.

Now, I want to do summation on "vmonth1_Revenue".  The problem is column show up as "April_Revenue".  I am going to refresh the report every month so I want to refer variable instead of actual column name.

I tried following variety of expression, all of them either gave me "Missing ( - ) " or " Zero ( 0 )" or nothing as output.

=sum(TEXT('$(=vRotate_month1)'&'_Revenue'))

=sum($(=vRotate_month1) &'_Revenue'))

=sum('$(vRotate_month1)' & 'Revenue_' )

One suggestion was to create another variable: vTEST= vRotate_month1&'_Revenue'  and do =sum(vTEST).

It works, but I have 20 variable to sum upon. I don't want to create 20 temproary variables. I am sure there is easy way.

Help me out.

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

You have to ignore the red underline error indicator in the expression editor. If vTEST= vRotate_month1&'_Revenue'  and =sum(vTEST) works then =sum($(vRotate_month1)_Revenue) will work also.

View solution in original post

4 Replies
Not applicable
Author

Try

=sum($(vRotate_month1)_Revenue)

Not applicable
Author

No that didn't work.

I got red underline on "_Revenue" part

Not applicable
Author

You have to ignore the red underline error indicator in the expression editor. If vTEST= vRotate_month1&'_Revenue'  and =sum(vTEST) works then =sum($(vRotate_month1)_Revenue) will work also.

jozsefpeitli
Contributor III
Contributor III

Dear All,

Unfortunately it is not working for me...

I am using qlik sense.

I try to achieve something like this:

I can set this: "vMeaseure = FieldName"

I try to use this as a measure:

=$(vMeasure)_min

To achieve this:
=FieldName_min

How should I use it properly?

So I have a lot of Field in my table. And I have another table with the same fieldname + "_min".

Thank you for your help.