Qlik Community

Ask a Question

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Qlik Sense - Reuse calculated field in the same load script

Dear Community,

How to reuse calculated field in the same load script?

[Table]:

LOAD

  [Invoice No]

, [Quantity]

, [Price]

, [Quantity] * [Price] AS [Amount]

, [Amount]  * {Rate] AS [GST]

FROM [lib://Files/table.xlsx]

(ooxml, embedded labels, table is Sheet1);

In the same load script, same table

[GST] =  [Amount] * {Rate] AS [GST]

instead of

[GST] = ( [Quantity] * [Price] ) * {Rate] AS [GST]

1 Solution

Accepted Solutions
Specialist
Specialist

[Table]:

LOAD *,

        [Amount] * [Rate] AS [GST];

LOAD

  [Invoice No]

, [Quantity]

, [Price]

, [Rate]

, [Quantity] * [Price] AS [Amount]

FROM [lib://Files/table.xlsx]

(ooxml, embedded labels, table is Sheet1);

Cheers

Luis

View solution in original post

2 Replies
Specialist
Specialist

[Table]:

LOAD *,

        [Amount] * [Rate] AS [GST];

LOAD

  [Invoice No]

, [Quantity]

, [Price]

, [Rate]

, [Quantity] * [Price] AS [Amount]

FROM [lib://Files/table.xlsx]

(ooxml, embedded labels, table is Sheet1);

Cheers

Luis

View solution in original post

Contributor III
Contributor III

Thanks Luis,

Actually I have more than hundred of calculated fields

and so on will be like this?

[Table]:

LOAD *

    , etc....

LOAD *

    , [GST] + [Amount] AS [Gross Amount];

LOAD *

    , [Net Amount] * [Rate] AS [GST];

LOAD [Invoice No]

,[Quantity]

,[Price]

,[Rate]

    ,[Quantity] * [Price] AS [Net Amount]

FROM [lib://Desktop/table.xls]

(biff, embedded labels, table is Sheet1$);