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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Query in Expression...

Hello Everyone,

I have one column, 'Cause Code'. The few values of 'Cause Code' should be grouped together.

  'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing' should be grouped as 'Data Issue'.

The summed values should be shown against 'Data Issue'.

Can you please suggest me? Appreciate your valued suggestions.

Thanks.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try if this helps:

Table1:

LOAD [Cause Code],

          If(Match([Cause Code], 'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'), 'Data Issue') as Data Issue,

          Value

Resident SomeTable;


Join (SomeTable)

LOAD [CauseCode],

          Sum(Value)

Resident Table1

Group By Data Issue;


Best,

S

View solution in original post

5 Replies
Not applicable
Author

Hi,

You can use a Lookup Table and use APPLY MAP to get the result.

Regards,

Nandkishor

Not applicable
Author

Hi NandKishor - Thanks for your response. Can you please provide me a sample code. Thanks

Not applicable
Author

Sample Look-up Table like below

LOAD * INLINE

[

Cause Code , Output

Data Entry Issue, Data Issue

File Missing/Deleted,Data Issue

Data Exception,Data Issue

];

and use Apply map to existing query and pass 'cause code'

sunny_talwar

Try if this helps:

Table1:

LOAD [Cause Code],

          If(Match([Cause Code], 'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'), 'Data Issue') as Data Issue,

          Value

Resident SomeTable;


Join (SomeTable)

LOAD [CauseCode],

          Sum(Value)

Resident Table1

Group By Data Issue;


Best,

S

Not applicable
Author


Hi Sasi,

You may try an If() clause to Match the field values and to group them,

In the script,

if(Match([Cause Code],  'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'),'Data Issue'

,[Cause Code]) // Else takeup values in [Cause Code]

Hope it helps !

Cheers !