Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jpjust
Specialist
Specialist

Date comparison set analysis

Hi,

I have an table and expression but not getting the desired output, can some one please take a look and let me know.

Original table is below.

App Name                              App Publish Time

AppTestA                                 2021-10-15 05:51:59

AppTestB                                2021-10-14 03:51:59

What I want is the list of app's that has App Publish Time is today date.

So my measure expression is below for App Name as below.

=Aggr(Only({<(Date([App Publish Time])) = {'$(=Date(Today(),'YYYY-MM-DD'))'}, [App Stream] -={Unpublished}>}[App Name]),[App Name])

The resulting table is not displaying anything when I am expecting to return the first record (AppTestA)

If anyone can let me know what is wrong with the expression, would be helpful.

Thanks

3 Replies
rubenmarin

Hi, set analysis syntax expects a field name on the left of the '=', it couldn't be something calculated like Date([App Publish Time]),it expects just [App Publish Time].

You may edit the script to create an [App Publish Date] field from the [App Publish Time] field, and use this new field in set analysis.

Also note than if the aggr returns more than one value (more than one app was published in the date selected) it will return null(), you will need some aggregation formula to tell what to do with those different values, it could be a concat(Aggr(...)), maxstring, minstring...

jpjust
Specialist
Specialist
Author

Thanks Ruben, that was quite useful.

Unfortunately, this condition is not working  [App Stream] -={'Unpublished'}. Though I applied this condition on my set analysis expression, this still brings Unpublished app's.

I want to get rid of all Unpublished app's from the output.

Any idea?

Thanks

rubenmarin

Hi, I don't see anything wrong in that condition, try doing a manual selection of all [App Stream] values except 'Unpublished' and check the value returned, maybe it's a data model issue and [App Stream] is not related with the data as you think. 

Also double check upper and lowwer cases, both the field name and the value needs to have all lettres in the same case.