Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

First value for specific id with multiple same values

Hello.
Here is the scenario.

IDValue
1Value Text
1Value Text
1Value Text
1Not Wanted Value Text

 

The question is how to see like this table:

IDValue
1Value Text

 

Always there is a multiple the same ID.
Every single ID have multiple values, only the last value is different.
I need to get only Value Text, which is text.
The last value is text that I don't need.

4 Replies
Highlighted

So, you want to do this in the script and you only want a single row with the value text which is not associated with the last row?

Highlighted
Contributor II
Contributor II

Yes. I was trying from the table chart but didn't success.

Highlighted
Partner
Partner

Hi,

 

My question is, would you always know the value you wish to exclude?

If the answer is yes, then in your UI you can exclude the value using 

COUNT({<Value -={'Not Wanted Value Text'}>} ID)

And in script use 

tmp:
LOAD * INLINE [
ID, Value
1, Value Text
1, Value Text
1, Value Text
1, Not Wanted Value Text
](delimiter is ',')
WHERE NOT MATCH(Value,'Not Wanted Value Text');

 

Let us know if this helps

Highlighted
Contributor III
Contributor III

Hi,

If you only want to load first value then use below code

LOAD ID,
firstvalue(Value) as Value
FROM
Source group by ID;

Regards,
Sultan