Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help to get the correct expression in a chart

Hi Everyone,

I have two problems below, which I really, really need help:

1. I have a data with these fields: Region, Status_Fg (could be A, D, I) and Wave_Id

I have to count the number of active Status_Fg (Status_Fg = A) per Region and put them in a pie chart. So, I have my Region as dimension. For expression, I tried this: if(STATUS_FG='A',Count(DISTINCT WAVE_ID)), I need to put in DISTINCT, because the wave_id in my data is not unique, but I only need to count the unique wave_id. But this is not working. I get 'no data to display'. But I know that there are wave with status_fg = A

2. I have these data: Region, Round_id, parent_round_id.

I need to have a bar chart with the % of rounds copied to the # of rounds created per region. Copied rounds are those rounds where the parent_round_id is not null or not equal to zero. So, i have Region as dimension. then i have two expressions. One is just to count all the rounds, so I put in Count(DISTINCT round_id). Second is to count only the copied rounds, so I put in if(parent_round_id<>0 or not isnull(parent_round_id), Count(DISTINCT round_id)). But this is not working, Im getting the same count number as all the rounds.

Any help is greatly appreciated.

Thanks very much.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Answer of your first question is below expression.

     Count({<STATUS_FG={"A"}>} Distinct WAVE_ID)

     Answer to your second question is.

     Count(if(parent_round_id<>0 or not isnull(parent_round_id),round_id)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Answer of your first question is below expression.

     Count({<STATUS_FG={"A"}>} Distinct WAVE_ID)

     Answer to your second question is.

     Count(if(parent_round_id<>0 or not isnull(parent_round_id),round_id)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

thank you very much. it solved my problem 🙂