Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
louise119
Creator III
Creator III

Let and inline

I wanna make table like below.
But the variables are empty.
Does anyone know what is wrong?

Let vA = Sum([Field]);
Let vB = Sum([Field]);

Table1:
LOAD * Inline
[
column1,column2
aaa,$(vA)
bbb,$(vB)
];

Thank you.

1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Ok,

 

Set vA = Sum(Field);
Set vB = Sum(Field);

Load
  *
Inline [
  Field
  10
  20
];

Table1:
LOAD 
  column1,
  Replace(column2, '%', '$') as column2
Inline
[
column1,column2
aaa,$(vA)
bbb,$(vB)
];

 

And the expression :

Aurelien_Martinez_0-1691078578634.png

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

8 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

Set vA = Sum([Field]);
Set vB = Sum([Field]);

Table1:
LOAD 
  column1,
  Replace(column2, '%', '$') as column2
Inline
[
column1,column2
aaa,%(=%(vA))
bbb,%(=%(vB))
];
Help users find answers! Don't forget to mark a solution that worked for you!
louise119
Creator III
Creator III
Author

Thank you.
But I couldn't get the value of column2...

test.png

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Ok,

 

Set vA = Sum(Field);
Set vB = Sum(Field);

Load
  *
Inline [
  Field
  10
  20
];

Table1:
LOAD 
  column1,
  Replace(column2, '%', '$') as column2
Inline
[
column1,column2
aaa,$(vA)
bbb,$(vB)
];

 

And the expression :

Aurelien_Martinez_0-1691078578634.png

 

Help users find answers! Don't forget to mark a solution that worked for you!
louise119
Creator III
Creator III
Author

Thank you so much.
I copied your script and excuse, but I couldn't get the value...

test1.png

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

You need to create a measure like : $(=Only(column2))

Help users find answers! Don't forget to mark a solution that worked for you!
louise119
Creator III
Creator III
Author

Thank you so much.
I can get the value when the field name is same.

I wanna use different field name like below,

Set vA = Sum(Field_1);
Set vB = Sum(Field_2);


But in this case, I can't get the value. 

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

I found a problem when vA and vB are not the same 😱

Pick(Match(column1, 'aaa', 'bbb'), $(=Only({<column1={'aaa'}>} column2)), $(=Only({<column1={'bbb'}>} column2)))

Aurelien_Martinez_0-1691080912458.png

 

Help users find answers! Don't forget to mark a solution that worked for you!
louise119
Creator III
Creator III
Author

Thank you so much🙏

I solve the problem!
and I got the same value with your script.

test2.png