row | value | value[0,2]+facetCount(value[0,2],"value[0,2]","Vendor_Name") |
1. | ||
2. | ||
3. | ||
4. |
row | value | value[0,2]+facetCount(value[0,2],"value[0,2]","Vendor_Name") |
1. | ||
2. | ||
3. | ||
4. |
3. Sort by "prefix" and invoke Re-order rows permanently.
4. Switch to "record" mode.5. Create a new column based on column prefix, with the expression:value + (row.index - row.record.fromRowIndex + 1)
Let me know if that works!David
3. Sort by "prefix" and invoke Re-order rows permanently.Didn't see where to Re-order rows permanently. Something missing now in /trunk r2090 ?
Ah, never mind... I just found the usefulness of having a quick Sort
dropdown selector.
David HAS thought of everything. ;)
Hi drLization,Today I checked in a change that would support your use case. You could try checking out the code from trunk/ if you like, or wait for the 2.1 release. With this change, you can solve your problem by the following steps1. Create a new column called "prefix" based on Vendor_Name, with expression:value[0,2]2. Re-order the columns so that "prefix" is the first column.3. Sort by "prefix" and invoke Re-order rows permanently.4. Switch to "record" mode.5. Create a new column based on column prefix, with the expression:value + (row.index - row.record.fromRowIndex + 1)Let me know if that works!
David
> I was looking for a way to get the row index within a record ... thanks
> for the tips.
> In my case instead of adding 2 or 3, I want to add 0.2 or 0.3
> I've tried the following toNumber(row.index - row.record.fromRowIndex +
> 1)/10 but grefine returns 0.
That's a quirk of the way that computers/programming languages treat
numbers. Integer arithmetic is used if all the operands are integers.
If you divide by 10.0 instead of 10, you'll get the result that you
expect.
It could be argued that, as a tool for non-programmers, Refine would
be better off using floating point for everything, but that'd probably
have other unexpected side effects (e.g. weird roundoff effects due to
the way computers encode floating point numbers).
Tom
The biggest annoyance in my experience is that equality is effectively undefined for floating point owing to approximate representations. To non-programmers that's probably even more surprising :-/
Yes, "approximate representations" is what my "weird roundoff effects"
was referring to. Explaining the concept of comparing to an epsilon
in order to determine approximate equality seems likely to be even
more confusing to than explaining why integer and floating point
arithmetic work differently.
Tom