Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - I have a straight table and like to check if the dimensional value matches the value above: I've looked at the Above() function, but this seems to be for expressions and not dimensional values.
Looking for something like this:
If (Person = Person on Previous Row, THEN Same, ELSE Different)
Eg:
Row | Person (Sorted Alphabetically) | Dimensional Calculation |
---|---|---|
1 | David | - |
2 | John | Different (to Row 1) |
3 | John | Same (as Row 2) |
4 | Johnathan | Different (to Row 3) |
5 | Steve | Different (to Row 4) |
6 | Steve | Same (as Row 5) |
Help appreciated
Jay
Screen shots above?
Load *, RowNo() as Row Inline [
]
Straight table:
Calculated dimension: =Dual(Email, Row)
Expression: =If( Email=Above(Email), 'Same', 'Different')
As i understand, Use this? And, I always recommend you to create in script
LOAD Row,
[Person (Sorted Alphabetically)],
If(Row, Previous(Row)) as [Dimension Calculation]
FROM
[https://community.qlik.com/message/1271470]
(html, codepage is 1252, embedded labels, table is @1);
Hi Anil - that's not quite what I'm expecting...I added the Row column to help with the understanding of the problem.
Problem:
For the current row, I want to check the dimensional value of the previous row to determine if the same value.
Jay
May be not understand fully? Would you tell us expected result, That may helps
hi - For simplicity, My qlikview straight table looks like this: (The duplicates are expected and needed).
Person1@email.com |
Person2@email.com |
Person2@email.com |
Person2@email.com |
Person3@email.com |
Person3@email.com |
Person4@email.com |
I want this output:
Check | |
---|---|
Person1@email.com | |
Person2@email.com | Different |
Person2@email.com | Same |
Person2@email.com | Same |
Person3@email.com | Different |
Person3@email.com | Same |
Person4@email.com | Different |
Thanks, Jay
Like this?
Tresesco B - Any chance you can put the code into a text file? I'm running a personal edition today and unable to open the file
Thanks Jay
If you are expecting same as Tresco suggestion, This may be
If(Email = Previous(Email),'Same','Different')
Screen shots above?
Load *, RowNo() as Row Inline [
]
Straight table:
Calculated dimension: =Dual(Email, Row)
Expression: =If( Email=Above(Email), 'Same', 'Different')
'Previous' is not a valid function