Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Sarath123
New Contributor II

How to use functions on the script to get only required rows for a huge data

Hello,
I have a sheet of data which has many rows. I need to calculate the sales based on the code provided.

Sales for code1530 is calculated as sales(code(1530)-code(1547)-code(15500140)-code(15500240)-code(15904001)-code(15904002)-code(15904003))

sales for code1547 is calculated as sales(code(1547)-code(15500140)-code(15500240)-code(15904001)-code(15904002)-code(15904003))

sales for code1550 is calculated as sales(code(1550)-code(15500140)+code(15500240))

Sales for code1590 is calculated as sales(code(1590)-code(15904001)+code(50904002)+code(50904003))

I have many other calculations similar to the above

Both the company and total sales should be calculated. I got help on this query previously and when I started executing it for the whole data it is taking 20min to load the full data  for the output
I need to show as a single table at the end and
can we use any function on the script which will load only the required code for getting the sales for that code?

Tags (1)
2 Replies
Partner
Partner

Re: How to use functions on the script to get only required rows for a huge data

Try where clause:

load *

resident [YourFilePath]

where match(Code,'A','B','C');

 

Replace all the codes required in the match function.

MVP & Luminary
MVP & Luminary

Re: How to use functions on the script to get only required rows for a huge data

Beside reducing the dataset with an appropriate where-clause like already suggested I think it might be useful to categorize the data within the script. I'm not sure from your description if you have one code-field or multiple ones - by the last you should consider to transform your data with The-Crosstable-Load.

- Marcus