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: 
suzel404
Creator
Creator

How can I calculate the site number that the state begin by 5 and finish by 7

Hi all,

How can I calculate in straight table the site number that the state begin by 5 and finish by 7 ?

I want all the site that the state begins  by 5 and finish by 7 : like the site 15614.

Thanks for your help.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe using aggr at SITE_ID level

=sum(aggr(

if(subfield(concat(distinct STATE_ID, '@', DATE_FROM), '@',1)=5

and subfield(concat(distinct STATE_ID, '@', -DATE_FROM), '@',1)=7,1)

,SITE_ID))

View solution in original post

4 Replies
maxgro
MVP
MVP

in a str tab chart

dimension     SITE_ID

expression    

if(subfield(concat(distinct STATE_ID, '@', DATE_FROM), '@',1)=5

and subfield(concat(distinct STATE_ID, '@', -DATE_FROM), '@',1)=7,1)

suzel404
Creator
Creator
Author

Thanks Massimo,

It is possibe to count that in a text object ?

maxgro
MVP
MVP

maybe using aggr at SITE_ID level

=sum(aggr(

if(subfield(concat(distinct STATE_ID, '@', DATE_FROM), '@',1)=5

and subfield(concat(distinct STATE_ID, '@', -DATE_FROM), '@',1)=7,1)

,SITE_ID))

suzel404
Creator
Creator
Author

Thanks you very much for your reactivity.