Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Expression

Hello everyone,


How I can get the result of a text from an expression in a pivot table? My text is "SUM (A)", which I have saved in a field.


Regards, Daniel

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Yes, you need to specify the sort weight in the concat, similar to what Miguel used, also in my variable:

=concat(FieldValue( 'FIELD2', valueloop(1,vMaxReg)),',',valueloop(1,vMaxReg))

edit: I attached my modifications together with Miguels suggestion.

edit2:

And as you see, Miguels expression is more simple, if you have a field F3. You could use mine without F3 if you change vMaxReg to something like count(FIELD2) (That's where I started from).

View solution in original post

20 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Daniel,

Where is your text. Is this a column value  or a variable ??

Not applicable
Author

Is a column in a table. One of my tables is as follows:


FIELD1  FIELD2

A             SUM (R1)

B             SUM (R2)

C             SUM (R1) + SUM (R2)

Not applicable
Author

Hi Daniel,

if I understand correctly you store your variables in a field of a table that you load into your qvw file.

dgonzalez wrote:

My text is "SUM (A)", which I have saved in a field.


You can:

  1. use the following loop to load your "Formulas" table into variables
    for i=0 to noofrows('Formulas')-1
      LET var_name= peek('Field1',i,'Formulas');
      LET $(var_name) = peek('Field2',i,'Formulas');
      TRACE Load Variable: $(var_name) = $($(var_name));
      next i
  2. use those variables with Dollar Sign Expansion to have Qlikview convert the expression text into a formula which gets calculated. 
    eg. your first variable "A" which contains the expression "Sum (R1)" can be used in a chart expression by using the variable "$(A)" which would have the same result as typing "Sum (R1)" into the expression.

If I misunderstood your question then it might be good to attach a sample qvw file so that we can see what you are trying to do.

Ingo.

Not applicable
Author

I can not understand you. I enclose my QlikView to see my situation. I need the column "Result" show me the value.


I hope you can help me. Regards, Daniel

Not applicable
Author

Anyone know how I can solve this problem?


Regards, Daniel


Miguel_Angel_Baeyens

Hi Daniel,

You can try something like

$(=FieldValue('FIELD1', RowNo()))

That will return the evaluation of FIELD1. But I don't see any relation between tables, so it's unlikely to return values other than the sum of all values or null (zero) because dimensions and expression have no links.

Hope that helps.

Miguel

Not applicable
Author

I just tested it and show me the result remains the same. I attached the document if you see something. The expression is indicated in the column "New expression."


Regards, Daniel.


Miguel_Angel_Baeyens

Daniel,

Try instead

=$(=FieldValue('FIELD2', RowNo()))

Because the field with the expressions is FIELD2 not FIELD1

Hope that helps.

Miguel

Not applicable
Author

You are right, I'm wrong but still writing always returns the result of the first row. Below is the document again with the correction.


Regards, Daniel