2

So in Qlikview, I am trying to make a conditional that would only display the table if the table has less than 50000 rows. How would I go about to doing this?

The table I am working with is used for the user to create their own reports. They are able to choose what fields they want to see and are able to see those fields next to a calculated value column. I have tried using the RowNo() and NoOfRows() functions but was not able to get anywhere with that. If you have any other ideas, I would appreciate it.

Thanks

siddhu
  • 369
  • 1
  • 6
  • 16

3 Answers3

2

Consider that the number of rows will be determined by the number of distinct entries for your dimension for the table. So you could use:

Count(Distinct myDimension) < 50000

Where myDimension is the dimension of your table (or some concatenation of many dimensions if you have more than one dimension in your table).

Chris J's answer should be faster than the above Count(Distinct... since it does not require runtime elimination of duplicates, but depending on your data, you may need to create an extra table with a resident load to contain the counter correctly.

In my experience however, users prefer to have a logical limit on their data (something like being forced to select a week) rather than having a fixed limit to the number of records.

You can enforce this kind of limit with a condition like

GetSelectedCount(myWeekField) <= 1
Community
  • 1
  • 1
Nameless One
  • 1,615
  • 2
  • 23
  • 39
1

As part of your load script, you should add an additional field to the table that you are

,1 as RecordSum;

Then set a variable in the script

set vRecordSum = sum(RecordSum)

Then, on the straight table set to conditional with the formula $(vRecordSum)<50000

Chris J
  • 938
  • 1
  • 8
  • 27
0

One easy way should be to do, as a condition :

SUM(1) < 50.000

Sum(1) should represent the number of rows.

BrunoMarques
  • 557
  • 2
  • 11