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

Variables in Inline table in qlikview table using let function

Hi,

I have a requirement to show the max of the percent calculated in variables to display using inline tables.

The max of value can change based on the data, hence using variables.

Inline is used as the fields are adhoc.

Attached is the qlikview file for reference.

Let   vsales1    = $(value1) ; (where value1 = max(Percent,1))

Let   vsales2    = $(value2) ; (where value2 = max(Percent,2))

Percent:

LOAD fact_key,

     account,

     Percent

FROM

(ooxml, embedded labels, table is Sheet1);

Sales:

Load * Inline [

id@ sales

aabb1@ sales value is $(vsales1)

aabb2@ sales value is $(vsales2)

aabb3@ sales values is null

](delimiter is '@');

the expected result :

expected result.png

the actual result :

actual result.png

Thanks for your replies! !

1 Solution

Accepted Solutions
maxgro
MVP
MVP

if I understand, see atachment

View solution in original post

7 Replies
sunny_talwar

I don't think you can use a variable within a inline load. You can do something like this, but I doubt it would be very helpful, because it isn't very scalable.

Let   vsales1    = 60;

Let   vsales2    = 50;

Percent:

LOAD * INLINE [

    fact_key, account, Percent

    1, aa1, 50

    2, aa2, 60

    3, aa3, 40

    4, aa4, 30

    5, aa5, 20

    6, aa6, 10

    7, aa7, 11

];

Sales:

LOAD id,

  If(id = 'aabb1', sales & ' ' & $(vsales1), If(id = 'aabb2', sales & ' ' & $(vsales2), sales)) as sales;

Load * Inline [

id@ sales

aabb1@ sales value is

aabb2@ sales value is

aabb3@ sales values is null

](delimiter is '@');

maxgro
MVP
MVP

if I understand, see atachment

sunny_talwar

I guess I was wrong. The variable does work in inline load. Adding that to my list of things I know .

Sorry for guiding you incorrectly and thanks Massimo Grossi‌ for guiding me.

Best,

Sunny

Anonymous
Not applicable
Author

Harshala

This script  works fine :

Let   vsales1    = 1234 ;

Let   vsales2    = 5678 ;

Sales:

Load * Inline [

id@ sales

aabb1@ sales value is $(vsales1)

aabb2@ sales value is $(vsales2)

aabb3@ sales values is null

](delimiter is '@');

So I would suggest you look at how you load your variable.

Do note that in the script the max() function is only valid when used within a load statement, maybe something like this :

Temp:

LOAD

     Max(Percent) as MaxPercent

Resident YourTable ;

LET vsales1    = floor(peek('MaxPercent'));

drop table Temp ;

Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks a ton both of you (Massimo and Gysbert) !

Both the solutions works, Unfortunately we can mark only one as correct answer.

Not applicable
Author

hi all

this is kalyan i have requirement qlikview to  gemfirexd database is it possible connect windows system.

could plz help me,

thanks and advents

kalyan

obieekalyan50@gmail.com