Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stelozoya
Contributor II
Contributor II

Create a flag- measure to dimension

Hi All,

 

I have a table that contains detailed information from jobs. I am bringing in year 2020-2023, which causes the table to be too late to export. I am trying to create a filter based on a job count specific to the type of job. I was able to create the flag within the measure but I need to be able to click it to filter. The flag tells me if there is a job within the design I need, if there is I can create a filter to bring them in by identification number. 

 

I am having a difficult time converting it into a measure. I tried doing it with aggr but I do not get any results. My data and formula is:

 

=if((((SUM({<[Design]={'blue','red',}>} [jobs)))}>} [jobs]))))>0,'Yes','No') 

 

aggr formula that is not working:

=aggr(sum(if([Design]='blue' or [Design]='red',0,[jobs]>0),'Yes','No'),[identification number])

Identification num Design Detailed design Jobs
1 blue circles 2
1 red square 0
3 pink circles 5
4 blue triangle 4
5 black diamond 3

 

 

Any help would be amazing, thank you!

Labels (4)
1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Not sure I have all the info here, but it you have the data in the table above, to create a dimension showing No Jobs/ID, this is the expression:

=aggr(
Sum(Jobs), [Identification num]
)

Lisa_P_0-1682556220899.pngLisa_P_1-1682556235718.png

 

View solution in original post

4 Replies
Lisa_P
Employee
Employee

Not sure I have all the info here, but it you have the data in the table above, to create a dimension showing No Jobs/ID, this is the expression:

=aggr(
Sum(Jobs), [Identification num]
)

Lisa_P_0-1682556220899.pngLisa_P_1-1682556235718.png

 

Digvijay_Singh

I would prefer creating filter flag in the script, like this - 

Load *,
if (match(Design,'blue','red'),'Yes','No') as DesignFlag
;
Load *
inline [
Identification num, Design, Detailed design, Jobs
1, blue, circles, 2
1, red, square, 0
3, pink, circles, 5
4, blue, triangle, 4
5, black, diamond, 3

];

 

Digvijay_Singh_0-1682567809372.png

Just an idea, your needs could be different.

Thanks,

Prem0212
Creator
Creator

I think this expression will work for you  as a filter visual       =IF(Match(Design, 'blue', 'red'), 'Yes', 'No'

Prem0212_0-1682572111084.png

Please give me a like and accept the solution if u liked it

 

stelozoya
Contributor II
Contributor II
Author

Thank you so much, I had my formula in the incorrect format! This worked!