Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

rydr2102
New Contributor

Line Up 2 Rows from 2 Columns

I have loaded a table where two column/row combinations need to be displayed next to each other.

Actual Qlik Table Result

IDField TypeField String Value Field Date Value
1TypeStartednull
1Datenull6/15/18

I would like to get a result in a qlik table like this:

ID1Field String ValueField Date Value
1Started6/15/18

The 2 rows in the first example share the same ID#. 


Do I have any options of:

  1. Displaying the result in my 2nd table above.
  2. Getting to a place where I can assign the "Field Date Value" to the "Field String Value" dimension.


I am stuck on this one and wanted to ask the community since I am missing something here.

Thanks!

5 Replies
rydr2102
New Contributor

Re: Line Up 2 Rows from 2 Columns

I can't seem to get this working using crosstable.

Any ideas?

kaanerisen
Contributor III

Re: Line Up 2 Rows from 2 Columns

Hi Ray,

If you want to manage this on script side, you can use group by with maxstring function for the fields.

load

ID,

MaxString("Field String Value") as "Field String Value",

MaxString("Field Date Value") as "Field Date Value"

Inline [

ID,"Field Type","Field String Value","Field Date Value"

1,'Type','Started',

1,'Date',,'6/15/18'

]

group by ID;

Untitled.png

Untitled2.png

If you want to achieve this on front end, You can add measures to your table with maxstring function.

rydr2102
New Contributor

Re: Line Up 2 Rows from 2 Columns

Thanks for this but what about if there are multiple Types/Dates for the same ID?

ID  Field Type   Field String Value    Field Date Value
1    Type            Started                   
1    Date                                            6/15/18
1    Type            Ended
1    Date                                             6/20/18

How would I handle this?

kaanerisen
Contributor III

Re: Line Up 2 Rows from 2 Columns

Hi Ray,

How abuot this,

load

ID,

IF(LEN("Field String Value")=0,Previous("Field String Value"),"Field String Value") as "Field String Value",

"Field Date Value"

Inline [

ID,"Field Type","Field String Value","Field Date Value"

1,'Type','Started',

1,'Date',,'6/15/18'

1,Type,Ended,

1,Date,,6/20/18

]

where len("Field Date Value")>0;

Untitled.png

rydr2102
New Contributor

Re: Line Up 2 Rows from 2 Columns

I can't get this to work. I am trying to have this be a new table and read from a resident table. It does not like the where clause before or after the resident table line.

Community Browser