Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Ilya_K
Contributor III
Contributor III

Qlik Sense Set analysis with variables and ignore other selections

Hi to all .

Background : 

I need to create a calculation with a variable like  this 

Count ({ <DATE={'$(=$(vPrev_Month))'}>} PRODUCT_ID) ) and it's work OK .

Issue: If the user selects only the current month the calculation result return 0 .

Complication: I can't use  Count ({ 1<DATE={'$(=$(vPrev_Month))'}>} PRODUCT_ID) ) because other selections need to reduce product population without problem.

Thanks for help in advance )

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You couldn't specify a field several times within a single set statement. Meant was to ignore a selection within MONTH and applied selections came from DATE. If you have only one field DATE which didn't contained dates else a month-value (even if it's structured/formatted as date) you couldn't apply it in this way.

Beside this you need also to check how the variable is defined and if it may react on a selection. I suggest you elaborate in more details which fields with which values are there and should be used as selections, how the variable is defined and the data are associated.

View solution in original post

5 Replies
marcus_sommer

Maybe with:

Count ({ <DATE={'$(=$(vPrev_Month))'}, MONTH = >} PRODUCT_ID) )

Ilya_K
Contributor III
Contributor III
Author

Hi , I tried this   ({ < DATE=, DATE={'$(=$(vPrev_Month))'}>} PRODUCT_ID) )  Doesn't work  

Ilya_K
Contributor III
Contributor III
Author

I change the order ({ <DATE={'$(=$(vPrev_Month))'},  DATE=   >} PRODUCT_ID) ) and this doesn't work either. The result ignores the variable and represent selected month .

marcus_sommer

You couldn't specify a field several times within a single set statement. Meant was to ignore a selection within MONTH and applied selections came from DATE. If you have only one field DATE which didn't contained dates else a month-value (even if it's structured/formatted as date) you couldn't apply it in this way.

Beside this you need also to check how the variable is defined and if it may react on a selection. I suggest you elaborate in more details which fields with which values are there and should be used as selections, how the variable is defined and the data are associated.

Ilya_K
Contributor III
Contributor III
Author

OK , thank  you I got it .

I just split the DATE  field to year , quarter and year_month .

And applied DATE  in function and    year_month  in filters  

Count ({ <DATE={'$(=$(vPrev_Month))'}, YEAR_MONTH = >} PRODUCT_ID) )  and it's works .