Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can we write an expression to return the value of a field at row number 20?
Is Row Number a field in your data model or does this refer to a line in a chart?
Field 1 | Field 2 |
---|---|
A | 100 |
B | 200 |
C | 150 |
D | 120 |
Row number is the line number of an excel sheet from which data is taken. For example, I want the value of "Field 2" at row number 3 which is "150"
Add this to your script:
rowno() as row,
I would add this to the load statement for this table from excel:
TableName:
Load
....
RowNo() as RowNum
....
;
SelectedRow:
Load
*
Resident TableName
where RowNum = 20;
You can then use any information from SelectedRow in your scripting. If you plan on using this in a chart in the document itself, I would recommend a Set Analysis expression:
sum({$<RowNum = {20}>}Field1)
you can add in your script while loading the data rowno() and then in your set analysis you can filter on that.
Hi,
Table:
Load *, rowno() as rownum
From Sample.xls;
Tab2:
Load *
resident Table where rownum=3;
(Or else)
Tab2:
Load *
resident Table where rownum>3 and rownum<4;
Drop table Table;
RowNo( )
Returns an integer for the position of the current row in the table QlikView
Nishant,
Given the number of nearly identical responses to mine, I would appreciate the points if this has solved your problem.
Many thanks,
Steve