Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
bjchristie
Contributor II
Contributor II

set expression with dollar expansion

I recently asked how to write a set expression that would select the last run time (regardless of selection) using a date variable (calendar_dt) and a time variable (batch_time). The solution was

=time(max({1<calendar_dt={"$(=maxstring({1}calendar_dt))"}>}batch_time))

There is a third datetime variable in the data, batch_dttm, that has the format (DDMMMYY:hh:mm) and the data also has a variable that gives the server name (hostext).

I want to display the max value of a variable (measure) for each server (dimension) regardless of selection FOR the last run time. I have been studying "Les set analysis_ENG.pdf" that I found in the forums, but the proper syntax is still eluding me.

I have the following:

Max({1<hostext={S1234}, batch_dttm={'$(=Maxstring({1}timestamp#(batch_dttm,'DDMMMYY:hh:mm')))'}>}var1)

It returns a dash (-) However, I get a result if I hard code a batch_dttm, by replacing the red text with a value, for example:

Max({1<hostext={S1234}, batch_dttm={'15MAR19:20:00'}>}var1)

Why is the dollar expansion not working? How does qlik resolve it? When do you need a preceding equal sign? 

 

Labels (3)
11 Replies
dplr-rn
Partner - Master III
Partner - Master III

Whats the output when you put the inner expression in a text object?
i.e. Maxstring({1}timestamp#(batch_dttm,'DDMMMYY:hh:mm'))

gut feeling is that it will be wrong.
bjchristie
Contributor II
Contributor II
Author

What is a text object and how do you create one?

I will research this idea but asking you will explain any future delayed response on my part. 🙂

I am hoping that your answer will be faster than my research.

dplr-rn
Partner - Master III
Partner - Master III

kpi chart or text and image chart in qlik sense
bjchristie
Contributor II
Contributor II
Author

Oh. ok.

I already have a KPI for.... Maxstring({1}timestamp#(batch_dttm,'DDMMMYY:hh:mm')) and it gives me the correct answer. '15MAR19:20:00'

So there must be something fundamental that I am not understanding.

I even hard-coded '15MAR19:20:00' into the KPI and it gives me the correct answer, but it will not resolve the $ expansion.

dplr-rn
Partner - Master III
Partner - Master III

whats the data type for batch_dttm in your data model?
bjchristie
Contributor II
Contributor II
Author

I export the batch_dttm field as a datetime format from SAS to a CSV file.  I do not know how Qlik interprets it. I don't see any details about the field properties when I edit the table in the data manager.

dplr-rn
Partner - Master III
Partner - Master III

bjchristie
Contributor II
Contributor II
Author

$ascii $text

dplr-rn
Partner - Master III
Partner - Master III

hm...
are you using this expression with a chart? with other dimensions?
if so add a TOTAL qualifier there too Maxstring(TOTAL {1}..