Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Lisa2
New Contributor

Variable in Load Script

Hello, I am trying to make a variable in the load script but there are errors so I'm not sure if it is possible.  I would like to make a variable that is the sum of Items from a year range. 

Load:

Items,

Sum(Items where Year 2000 >= =< 2005 from excel file) as Range,

Location,

cost,

Year

From Excel File;

Labels (2)
2 Replies
Highlighted
Taoufiq_ZARRA
Valued Contributor

Re: Variable in Load Script

you have to use a group by.
Can you share a sample data  to share the exact answer?


Taoufiq ZARRA
Highlighted
mousumimondal
New Contributor II

Re: Variable in Load Script

Hi Lisa,

Please create a variable (say: vRentableArea) from Setting--> Variable Overview and set default value as 0.

Then write below the script to get the sum of field values and rename as name of the variable vRentableArea.

RentableArea:


LOAD
sum([Rentable Area (SqFt)]) As vRentableArea
FROM [..\Data\Report B.xls](biff, embedded labels) WHERE [Event Year Group] = '2020';

Let vRentableArea = Peek('vRentableArea',0,'vRentableArea');

 

Now load the script again and you can have the vRentableArea variable with expected value at front end.

Hope this will be a helpful solution.

 

Thanks

Mousumi