Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dcd123456
Creator
Creator

First Function() in a table graph

Hello

i have a date table like this

   

Idusuariotxt
12usr1prueba1
534usr2prueba1
34usr3prueba1
3usr4prueba3
26usr5prueba2

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

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

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.

View solution in original post

18 Replies
jyothish8807
Master II
Master II

Hi dcd,

Can you please share the output you are expecting ?

Regards

KC

Best Regards,
KC
sunny_talwar

May be this:

Capture.PNG

Expression1:

SubField(Aggr(Concat(DISTINCT usuario, '|'), txt), '|', 1)

Expression2:

SubField(Aggr(Concat(DISTINCT Id, '|'), txt), '|', 1)

jyothish8807
Master II
Master II

Nice logic sunny

Best Regards,
KC
sunny_talwar

Thank you

dcd123456
Creator
Creator
Author

Hello

this result with is valid for us, showing the first value of userid and id  for each txt value, but we need do this in the expresion of the table graph not in the load script.

 

txtcount(DISTINCT Id)usuarioId
prueba15usr112
prueba21usr526
prueba32usr43
prueba42usr7

5

If it is not possible extract the first value in the expresion of the graph,  also is valid for us show only one value of usuario and id, for example to the text "prueba1", is valid for us show one of next rows:

  

usuarioId
usr112
usr2534
usr334
usr8323
usr10444

only one value of usuario and id, linked with each value of txt.

thanks

regards

dcd

dcd123456
Creator
Creator
Author

Great solution!!!

Tanks very much

Best Regards

dcd

sunny_talwar

No problem. I am glad I was able to help.

Best,

Sunny

tamilarasu
Champion
Champion

Hi Sunny,

Can you check your expression against the below excel.

Capture.PNG

tamilarasu
Champion
Champion

I am not sure about his requirement but this will produce the same output .

Data:

LOAD RecNo () as Rec,

    Id,

    usuario,

    txt

FROM

(ooxml, embedded labels, table is Hoja1);

Expressions: FirstSortedValue(usuario,Rec)

                    FirstSortedValue(Id,Rec)

Capture.PNG