Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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.

1 Solution

Accepted Solutions
Highlighted
Not applicable

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
Highlighted
Not applicable

Try

=sum($(vRotate_month1)_Revenue)

Highlighted
Not applicable

No that didn't work.

I got red underline on "_Revenue" part

Highlighted
Not applicable

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

Highlighted
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.