Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

vchuprina
New Contributor II

Row count in mapping table

Good Morning,

I understand that Mapping table is hard coded table and we can simply count number of row manually. But Is it possible to get row count of the mapping table by using Qlikview?


For example table below:


CityMap:

  Mapping LOAD * Inline

  [

  City_Name, CITY_NUM

  PARIS, 6

  LONDON, 4

  LA, 347

  SEATTLE, 11

  CHICAGO, 12

  ];

  ENDIF

1 Solution

Accepted Solutions

Re: Row count in mapping table

May be this:

TempCityMap:

  LOAD * Inline

  [

  City_Name, CITY_NUM

  PARIS, 6

  LONDON, 4

  LA, 347

  SEATTLE, 11

  CHICAGO, 12

  ];

RowCount:

LOAD Count(City_Name) as RowCount

Resident TempCityMap;

CityMap:

Mapping

LOAD City_Name,

          CITY_NUM as City_Num

Resident TempCityMap;

DROP Table TempCityMap;

8 Replies

Re: Row count in mapping table

May be this:

TempCityMap:

  LOAD * Inline

  [

  City_Name, CITY_NUM

  PARIS, 6

  LONDON, 4

  LA, 347

  SEATTLE, 11

  CHICAGO, 12

  ];

RowCount:

LOAD Count(City_Name) as RowCount

Resident TempCityMap;

CityMap:

Mapping

LOAD City_Name,

          CITY_NUM as City_Num

Resident TempCityMap;

DROP Table TempCityMap;

markodonovan
Valued Contributor

Re: Row count in mapping table

Hi there,

You could also add the count into a variable as follows:

LET TableCount = NoOfRows('TempCityMap');

--Update This would need to be used on the TempCityMap table as in Sunny's example.

Thanks

Mark

http://techstuffybooks.com

Re: Row count in mapping table

I just tried it with a sample app, doesn't seem to be working with Mapping LOAD.

Re: Row count in mapping table

Naresh‌, logfile does seem to have the row count information for Mapping Load

Capture.PNG

markodonovan
Valued Contributor

Re: Row count in mapping table

Hi Sunny,

My mistake,

I just copied your TempCityMap and just realized it wasn't a mapping load.


Thought I was missing something about the question.


Mark

Re: Row count in mapping table

No problem.

In full disclosure I had no idea if NoOfRow('TableName') would work or not, but would have been glad if it did

nareshguntur
Valued Contributor

Re: Row count in mapping table

Thanks Sunny.

Somehow, I missed it.

vsudhakar
Contributor III

Re: Row count in mapping table

=count(City_Name)

Community Browser