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

How to get count??

I am loading only one column from Qvd

Orders:

Load Order_No

From c:\ORD.qvd(Qvd);

I want to get the cont of distinct Orders_No into script and store in the variable at the script level only.

Hoe to do this?

Thanx in Advance..!!

1 Solution

Accepted Solutions
Not applicable
Author

Hi, you need to load your table in temporary table usuing COUNT(DISTINCT YOUR_VALUE).

To read the value and insert into a variable, use the function PEEK;

Ex.:

Orders:

Load Order_No

From c:\ORD.qvd(Qvd);

NOCONCATENATE

TMP:

LOAD COUNT(Distinct Order_No) AS Qty

RESIDENT Orders;

LET vQty = PEEK('Qty', 0, 'TMP');

DROP TABLE TMP;

View solution in original post

4 Replies
Not applicable
Author

Hi, you need to load your table in temporary table usuing COUNT(DISTINCT YOUR_VALUE).

To read the value and insert into a variable, use the function PEEK;

Ex.:

Orders:

Load Order_No

From c:\ORD.qvd(Qvd);

NOCONCATENATE

TMP:

LOAD COUNT(Distinct Order_No) AS Qty

RESIDENT Orders;

LET vQty = PEEK('Qty', 0, 'TMP');

DROP TABLE TMP;

Anonymous
Not applicable
Author

Hi,

Please check the application,by using peek function you can take value into variable.

Regards

Not applicable
Author

Thnx.. It is perfect..

Anonymous
Not applicable
Author

Sorry,

  Please find the attachment of applicatio,

Regards