

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any peek-like function in chart or expression?
Hi,
I have a chart that counts distinct users logging in over time. How can I have a text box/table/chart where it shows only new users logging in? i.e. were not logged in in the previous month. e.g. if 10 new users logged in in September, where new is defined as did not ever log in before (or did not log in the previous month), the chart should show 10 for September, instead of 1000 (total unique users in the month).
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's probably not impossible in chart. But possibility surely going to take you to a much complex expression. therefore, better to handle such situations in the script itself. Compare it and flag. Then in the front end use the flag to find new users.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
share sample so we can try and help you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use Below/Above function on the front end. But to give a more appropriate answer, it would be best if you can share a sample.
Best,
Sunny


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use above/below
above([ total ] expression [ , offset [,n ]])
Returns the value of expression evaluated with the chart's dimension values as they appear on the row above the current row within a column segment in a table or, in the case of bitmap charts, in the chart's straight table equivalent (Actually all QlikView charts have a straight table equivalent with the exception of the pivot table which has a more complex structure.).
On the first row of a column segment a NULL value will be returned, as there is no row above this one.
If the chart is one-dimensional or if the expression is preceded by the total qualifier, the current column segment is always equal to the entire column.
If the table or table equivalent has multiple vertical dimensions, the current column segment will include only rows with the same values as the current row in all dimension columns except for the column showing the last dimension in the inter field sort order. The inter field sort order for pivot tables is defined simply by the order of the dimensions from left to right. For other chart types this can be manipulated in the Chart Properties: Sort dialog.
Specifying an offset greater than 1 lets you move the evaluation of expression to rows further up the current row. A negative offset number will actually make the above function equivalent to a below function with the corresponding positive offset number. Specifying an offset of 0 will evaluate the expression on the current row. Recursive calls will return NULL.
By specifying a third parameter n greater than 1, the function will return not one but a range of n values, one for each of n table rows counting upwards from the original cell. In this form, the function can be used as an argument to any of the special Chart Range Functions.
Examples:
sum( Sales ) / above( sum( Sales ))
above( sum( Sales ), 2 )
above( total sum( Sales ))
rangeavg (above(sum(x),1,3)) | returns an average of the three results of the sum(x) function evaluated on the three rows immediately above the current row. |
below([ total ] expression [ , offset [,n ]])
Returns the value of expression evaluated with the chart's dimension values as they appear on the row below the current row within a column segment in a table or, in the case of bitmap charts, in the chart's straight table equivalent.
On the last row of a column segment a NULL value will be returned, as there is no row below this one.
If the chart is one-dimensional or if the expression is preceded by the total qualifier, the current column segment is always equal to the entire column.
If the table or table equivalent has multiple vertical dimensions, the current column segment will include only rows with the same values as the current row in all dimension columns except for the column showing the last dimension in the inter field sort order. The inter field sort order for pivot tables is defined simply by the order of the dimensions from left to right. For other chart types this can be manipulated in the Chart Properties: Sort dialog.
Specifying an offset greater than 1 lets you move the evaluation of expression to rows further down the current row. A negative offset number will actually make the below function equivalent to a above function with the corresponding positive offset number. Specifying an offset of 0 will evaluate the expression on the current row. Recursive calls will return NULL.
By specifying a third parameter n greater than 1, the function will return not one but a range of n values, one for each of n table rows counting downwards from the original cell. In this form, the function can be used as an argument to any of the special Chart Range Functions.
Examples:
below( sum( Sales ))
below( sum( Sales ), 2 )
below( total sum( Sales ))
rangeavg (below(sum(x),1,3)) | returns an average of the three results of the sum(x) function evaluated on the three rows immediately below the current row. hth Sasi |


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see attached sample data. the qvw has this data, and I've highlighted the new users (not appearing before in the data). So my end result should be a chart (or text box) that tells me the number of "new" users per month. So it should say April = 0, May = 1, June = 2
Date | User |
01/04/2014 | abc |
01/04/2014 | mgd |
01/04/2014 | pqf |
01/04/2014 | iiv |
01/04/2014 | pbr |
01/04/2014 | dsi |
01/04/2014 | upfaah |
01/04/2014 | ukzblg |
01/04/2014 | ukzblg |
01/04/2014 | dggunv |
01/04/2014 | qwumaa |
01/04/2014 | qwumaa |
01/04/2014 | qwumaa |
01/04/2014 | qwumaa |
01/05/2014 | qwumaa |
01/05/2014 | abc |
01/05/2014 | mgd |
01/05/2014 | pqf |
01/05/2014 | iiv |
01/05/2014 | pbr |
01/05/2014 | dsi |
01/05/2014 | upfaah |
01/05/2014 | ukzblg |
01/05/2014 | ukzblg |
01/05/2014 | dggunv |
01/05/2014 | wcmekc |
01/06/2014 | qwumaa |
01/06/2014 | abc |
01/06/2014 | mgd |
01/06/2014 | pqf |
01/06/2014 | iiv |
01/06/2014 | pbr |
01/06/2014 | dsi |
01/06/2014 | upfaah |
01/06/2014 | ukzblg |
01/06/2014 | ukzblg |
01/06/2014 | dggunv |
01/06/2014 | phsmgm |
01/06/2014 | nahujy |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think in this instance you will have to use combination of IF statement and ABOVE function to resolve this.
You have to check the Date & User.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create Month field in the script.
Straight table:
Dim: Month
Exp: Concat({<User={"=Count(User)=1"}>} Distinct User, ';')
PFA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think he is looking for a count. Modifying your expression for count:
=Count({<User={"=Count(User)=1"}>} Distinct User)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
put User as a dimension
with the expression as suggested above
Count({<User={"=Count(User)=1"}>} Distinct User)
hth
Sasi

- « Previous Replies
-
- 1
- 2
- Next Replies »