Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
i have a date table like this
Id | usuario | txt |
12 | usr1 | prueba1 |
534 | usr2 | prueba1 |
34 | usr3 | prueba1 |
3 | usr4 | prueba3 |
26 | usr5 | prueba2 |
i have created a table graph with the field Txt like dimension field, and a expresion to count the diferents txt fileds Count(distint Id), but
also i want to see in each row of the table the first value of the field id and usuario, i try the expresion first(id) but it don't return anything.
Somebody know how to show ony the first value of this field (id) for each each row.???
i have attached and excample
thanks in advance for your help
best regards
dcd
If we are adding a RecNo() or RowNo(), we can definitely use what you proposed or change my expression to this:
SubField(Concat(DISTINCT usuario, '|', Key), '|', 1)
Aggr() function sorts the data by load order and that is why I proposed its use. But Not sure why it isn't working with Concat. I will have to do further investigation into that or may be swuehl can help as he was the one who explained that Aggr() uses load order.
Best,
Sunny
I don't think the problem is caused by Aggr function. Even the above expression, produces the same result.
Aggr is not a problem here, I was thinking more of a solution. Check this thread I just created -> Load order in Concat() function
Here you go:
SubField(Concat(DISTINCT usuario, '|', Aggr(RowNo(), txt, usuario)), '|', 1)
SubField(Concat(DISTINCT Id, '|', Aggr(RowNo(), txt, usuario)), '|', 1)
But I guess this solution is good for someone trying to do this on the front end. If we can alter the script slightly, I would definitely do RecNo() or RowNo() in the script.
Best,
Sunny
If for example the same usuario value appears for more than one txt, the suggested solution might still fail.
(for example, add these two lines to the excel file:
99 | usr1 | prueba5 |
11 | usr2 | prueba5 |
)
There is a difference between field load order and record load order.
If there are only distinct values in field usuario and / or Id, the solution with aggr() should work, if you are chosing the right fields in the aggr() dimension.
In other words, to make it work, I think you need to identify some kind of primary key field in your table (maybe Id?)
So we still might need a unique id to for Aggr() function based on the dataset? That make sense. Thanks for chipping in and helping Stefan. Like always, your advice is always much appreciated.
Yes, we need some key field to identify the load order. That is the reason I suggested to modify the load script (RecNo or FirstValue syntax) else I would have suggested some expression (as he was not clearly mentioned his requirement. I thought he wants to show first value (he mentioned in subject line as first value) from the excel). RecNo() (Not Rowno()) works fine in the above cases. Anyways, he is happy with your solution.
Since we don't have a preceding load in the example, I don't see how is RecNo is different from RowNo() here?
And Finally you won the battle my Friend. Just to clarify, I never doubted what you proposed, I was just trying to provide a front end solution.
I have no idea about the front end solution in this particular case. So,I was interested to know, if there is any. Just now noticed, by mistake I have entered a wrong comment (It should be OR )
Cheers