Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
saumyashah90
Specialist
Specialist

Comparison like a for loop without a Macro


I have this list one in check.xlsx.

After i do group by on method name and show count(Parameters)

I get a list of Method Name and Count of Parameters like example

Method NameParameters
A2
B3
C3
D5

Now i want out put as

Source MethodDestination MethodSourceCountParametersDestinationcountparamters
AB23
AC23
AD25
BA32
BC33
BD35

This means i am comparing each method with all other method names with their paramters.

Let me know how cani achieve this.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this script

Temp:

LOAD * INLINE [ 

    Method, Parameter

    A, a

    A, b

    A, c

    A, f

    B, b

    B, c

    B, d

    B, f

    B, e

    C, a

    C, b

    C, x

    C, z

    C, r

    C, t

    D, w

    D, e

    E, a

    E, b

    E, c

    E, f

    F, a

    F, h

    F, g

    F, d

    F, f

];

Data:

LOAD

  Method AS SourceMethod,

  Count(Parameter) AS SourceCount

Resident Temp

Group by Method;

LEFT JOIN(Data)

LOAD

  SourceMethod AS DestinationMethod,

  SourceCount AS DestinationCount

Resident Data;

FinalData:

NoConcatenate

LOAD

*

Resident Data

WHERE SourceMethod <> DestinationMethod;

DROP TABLEs Temp, Data;

Regards,

Jagan.

View solution in original post

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this script

Temp:

LOAD * INLINE [ 

    Method, Parameter

    A, a

    A, b

    A, c

    A, f

    B, b

    B, c

    B, d

    B, f

    B, e

    C, a

    C, b

    C, x

    C, z

    C, r

    C, t

    D, w

    D, e

    E, a

    E, b

    E, c

    E, f

    F, a

    F, h

    F, g

    F, d

    F, f

];

Data:

LOAD

  Method AS SourceMethod,

  Count(Parameter) AS SourceCount

Resident Temp

Group by Method;

LEFT JOIN(Data)

LOAD

  SourceMethod AS DestinationMethod,

  SourceCount AS DestinationCount

Resident Data;

FinalData:

NoConcatenate

LOAD

*

Resident Data

WHERE SourceMethod <> DestinationMethod;

DROP TABLEs Temp, Data;

Regards,

Jagan.

saumyashah90
Specialist
Specialist
Author

Hi jagan its working fine
Can you please explain a little?

And also need one more help further with this as i see soem problem in output.

saumyashah90
Specialist
Specialist
Author

okay i understood

But can you tell me if i want to compare the values one by one in the same column ....what should i do?

suppose there are 1000 rows or more than that

jagan
Luminary Alumni
Luminary Alumni

HI,

Can you explain what do you mean by compare the values one by one in same column?  Can you explain with an  example?

Regards,

Jagan.

saumyashah90
Specialist
Specialist
Author

Yeah Jagan,

http://community.qlik.com/message/646457#646457

Aim is to remove duplicate methods which causes performance issues.

So there are some methods having same number of parameters and some are subset.so i want to know which all are duplicates and which all are subset or no match