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: 
Not applicable

I want to create an EXPRESSION ! Do help

Hello All,

The query here is I have some device which are frequently upgrading and after update they turn to again updating. For In progress the response code is 'NA' and for updated it is '0'.

I have one column with me which shows the date-time latest now I want to pick the

latest response code of a particular device id whether it would be '0' or 'NA' on basis of "com_send_time"  Column .

Scenario is lik this


P.S: I have around 700 device !


  

device_idresponse_codecom_send_time
1852NA23-07-2015 13:28
1852NA24-07-2015 11:42
1852023-07-2015 13:41
1852024-07-2015 11:54
1852--
2314NA24-07-2015 11:41
2314024-07-2015 11:59
2314-

-

As you can see above 1852 is showing different response code but I just want the count for the latest

i.e  24-07-2015 11:54

19 Replies
antoniotiman
Master III
Master III

Hi Cyrus,

Try this script

Temp:
LOAD device_id, response_code,
TimeStamp(TimeStamp#(com_send_time,'DD-MM-YYYY hh:mm')) as com_send_time 
Inline [
device_id, response_code,com_send_time
1852, NA, 23-07-2015 13:28
1852, NA, 24-07-2015 11:42
1852, 0, 23-07-2015 13:41
1852, 0, 24-07-2015 11:54
1852, -, -
2314, NA, 24-07-2015 11:41
2314, 0, 24-07-2015 11:59
2314, -,
-
]
;
  Inner Join LOAD
device_id,
Max(com_send_time) as com_send_time
Resident Temp
Group By device_id
;

Not applicable
Author

hello antonio,

I have many device_id bro like 700 how can I mention all in Inline

cant I use device ID column directly.

antoniotiman
Master III
Master III

I'm sorry,

but i didn't understant.

What is your source data ?

Not applicable
Author

Its on server so U cannot define the date I get automatically update on device response and there are around 24 tables interlinked so device total is 700 they all get frequent update so I jus want to see the latest response code of a particular device id which i will select.

Not applicable
Author

I want an expression guys..!! Not a Script!!

jus an normal expression to view the latest RESPONSE CODE on basis of com_send_time and show that  DEVICE ID

thats it !



settu_periasamy
Master III
Master III

Hi,

Try this

=FirstSortedValue(response_code,-com_send_time)

Not applicable
Author

It is showing blank space !!

like

-

settu_periasamy
Master III
Master III

may be like the attachment.

Not applicable
Author

I want to have the count of that device id with response code 0 or NA

the expression u gave me is returning a text