Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

Need help Counter Funtion

Hi All,

Could some help me this Query

p     p1,p2,p3,p1,p1
q     q1,q2,q3,q2,q2
r     r1,r2,r3,r1,r1
s    10101

By using counter function How should i display like it

p    p1
q    q1
r     r1

if im wrong corrent me how should i disply like the way

Thanks & Regards

Niranjan

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw

edit:

// The script to load some example data

Input:

LOAD *, if(not isnum(F2), SubField(F2,',')) as F3 INLINE [

    F1, F2 

    p    , "p1,p2,p3,p1,p1"

    q    , "q1,q2,q3,q2,q2"

    r    , "r1,r2,r3,r1,r1"

    s   , 10101

];

Add a straight table with F1 as dimension and as expression FirstSortedValue(F3, -aggr(count(F3),F3))


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw

edit:

// The script to load some example data

Input:

LOAD *, if(not isnum(F2), SubField(F2,',')) as F3 INLINE [

    F1, F2 

    p    , "p1,p2,p3,p1,p1"

    q    , "q1,q2,q3,q2,q2"

    r    , "r1,r2,r3,r1,r1"

    s   , 10101

];

Add a straight table with F1 as dimension and as expression FirstSortedValue(F3, -aggr(count(F3),F3))


talk is cheap, supply exceeds demand
NavinReddy
Creator II
Creator II
Author

Hi Gysbert,

im using persional edition so i can't able to open will you plz copy and paste it here

Thanks & Regards

Niranjan

Sokkorn
Master
Master

Hi Niranjan,

Try this

1. Load data

[Data]:

LOAD * INLINE [

    Field1, Field2 

    p    , "p1,p2,p3,p1,p1"

    q    , "q1,q2,q3,q2,q2"

    r    , "r1,r2,r3,r1,r1"

    s   , 10101];

2. Create Straight table

    a. Dimension: Field1

    b. Expression: If(IsNum(Field2),Null(),SubField(Field2,',',1))

Regards,

Sokkorn