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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Generating one Registry over Multiple Rows

Hello,

I have the following table:

ACCT_IDEXEC_DATECODE_DESC
00105/15/201410 - DESC A
00105/15/201420 - DESC B
00105/15/201430 - DESC C
00108/20/201415 - DESC D
00210/25/201430 - DESC C

What I need is to load that table in order to get one registry per ACCT_ID and EXEC_DATE only for the codes starting in 10, 15 and 30. The goal is to evaluate for a specific account and date if it has the mentioned codes.

I would need to do the following in the script. This is the final table I should get in the end:

ACCT_IDEXEC_DATECODE_10CODE_15CODE_30
00105/15/2014101
00108/20/2014010
00210/25/2014001

Is there any way to do this?

Thank you!

1 Reply
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

If you want in script

LOAD

*,

If(Left(CODE_DESC, 2) = '10', 1, 0) AS CODE_10,

If(Left(CODE_DESC, 2) = '15', 1, 0) AS CODE_15,

If(Left(CODE_DESC, 2) = '30', 1, 0) AS CODE_30,

FROM TableName;

Use Pivot Table:

Dimension: ACCT_ID, EXEC_DATE

Expression: Sum(CODE_10)

Sum(CODE_15)

Sum(CODE_30)

If you want this in front end

Use Pivot Table:

Dimension: ACCT_ID, EXEC_DATE, CODE_DESC

Expression:

     Count({<CODE_DESC={'10*', '15*', '30*'}>}CODE_DESC)

Now drag CODE_DESC column to top of the table to pivot.

Hope this helps you.

Regards,

Jagan.