Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

How to create a second column from a dimension value.


Hi, I was hoping someone here would be able to help me.


I have the below data and would like the dimension data as value in one column (as the results pic), instead of 3 records.

So the first Channel in 'Channel 1', the second Channel in 'Channel 2' - this is in order by 'TV_Date'

I managed to display the first value by the below code, but need help on the following columns...

=FirstSortedValue({<TV_Date={'=aggr(min(TV_Date), FTVID)'}>}Sender, TV_Date)

Any help appreciated!

Best,

Betul

Data

data.JPG

Results

results.JPG

1 Solution

Accepted Solutions

May be this in straight table

Dimension: FTVID

Expressions

Channel 1

=FirstSortedValue(Channel, TV_Date)

Channel 2

=FirstSortedValue(Channel, ((TV_Date)* 100000 + Ord(Left(Channel, 1))), 2)

Channel 3

=FirstSortedValue(Channel, ((TV_Date)* 100000 + Ord(Left(Channel, 1))), 3)

Capture.PNG

View solution in original post

5 Replies

May be try this:

What would Channel 2 = ? since both 13th Str and History have exactly the same TV_Date?

Contributor III
Contributor III

Hi Sunny, Can go by alphabetical order if the TV_Date is exactly the same.

May be this in straight table

Dimension: FTVID

Expressions

Channel 1

=FirstSortedValue(Channel, TV_Date)

Channel 2

=FirstSortedValue(Channel, ((TV_Date)* 100000 + Ord(Left(Channel, 1))), 2)

Channel 3

=FirstSortedValue(Channel, ((TV_Date)* 100000 + Ord(Left(Channel, 1))), 3)

Capture.PNG

View solution in original post

Contributor III
Contributor III

Hi Sunny,

That works great! Thank you so much for your help.

Betul

Not a problem