Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
It baffles me seeing so many people trying to figure out how to return something that seems so simple and struggling with it so much.
Myself included.
Why doesn't Qlikview have a simple function for a straight table as an example called DisplayedRowCount() or similar?
Today i'm working on an app that has a straight table for output as one example. Columns display and hide based on user filter selection. I can't seem to keep a correct count of rows currently displayed.
I've tried "1 AS #MyCounter" for each record loaded in script. This works until columns start to hide and the automatic Group By happens in the table.
I've tried Count and Count Distinct for every column in the straight table and none of those options maintain the count that's currently visible in the table.
I've tried RowNo from script, but this blows up my result set in my data model to trillions of rows wherein I need group by to happen at that level.
I'm at a loss right now. Any other ideas I can try?
My apologies. It does show the correct number of rows initially. Where I run into trouble is functionality in my app that shows and hide columns in the Straight Table. Let's say all columns are shown, 4 rows of data are shown and the code you've given shows "4 rows" in the Window Title. When I press a button that filters the Straight Table removing columns holding the unique data, only 1 row is now shown in the Straight Table due to QV's implicit group by functionality, yet the Window Title still shows "4".
Right, you would need to include this exclude / inlcude column logic also into the Count(DISTINCT ...) expression.
I haven't said it's a nice workaround. See also the reference thread for a more detailed discussion.
Regarding the reference thread. I tried using a variable and set it to code-based strings (variable="Count(DISTINCT(<column list>)" | variable="Count(DISTINCT(<paired down column list>)" and this indeed gives me the behavior.
Unfortunately this won't work for me either as it is incredibly slow having millions of rows in the Straight Table. When I toggle the UI button I wait for at least 30 seconds per toggle.
Is there a way to architect this from script?
=$Rows will return the total number of rows. If the same row of the data appears twice, a Straight table will only show one. However this function will count it as 2.
Is this what you need?
=$Rows
Displays "-" in the Window Title for the Straight Table
Count/Sum on that is incorrect too. Not sure if you had something else specific in mind regarding implementation?