Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

get number of rows for data for the current year and month

I have a table divers

SELECT [Code Site]

      ,[Datedesdivers]

FROM [dbo].[Divers]

I need to get number of rows for data for the current year and month

How can I modify it ?

let noRows = NoOfRows('Divers')

2 Replies
sunny_talwar

May be create a temporary table with only current year and month of data and count the number of rows in it?

Divers:

SELECT [Code Site],

              [Datedesdivers]

FROM [dbo].[Divers]

Temp:

NoConcatenate

LOAD *

Resident Divers

Where Num([Datedesdivers]) >= Num(MonthStart(Today()))

Let noRows = NoOfRows('Temp')

julian_rodriguez
Partner - Specialist
Partner - Specialist

I'm assuming that the code is the SQL code, so try something like adding a 1 for each row loaded:

LOAD 1 As NoRows,

     *;

SQL SELECT [Code Site]

      ,[Datedesdivers]

FROM [dbo].[Divers];

Then, on the front end, you can use Sum(NoRows) to get the number of rows for the current selections, on this table.

Regards,