Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Giuseppe_Alleruzzo
Contributor II
Contributor II

Filter a variable value

Hi guys, i've a problem. In my project i've many things to sum and all of them give results by year, month and day.

To simplify my scripts i created a variable "v_total_count" with inside it sum(A) + sum(B) + Sum(C) ....+ Sum(Z)

Now I want to create a chart with months as rows and total count for specific years as columns.

How can i do this without filtering dimensions in my dashboard?

For example as first column i'd like to have count month by month for year 2024

if i have an expression i do Sum({$<Year {'2024'}>}A)

What do i have to do to have the same filter for a variable?

Thank you so much

Labels (1)
14 Replies
Clement15
Partner - Specialist
Partner - Specialist

Hello,

Have you tried this?

{$<Year = {'2024'}>} $(v_total_count)

 

LRuCelver
Partner - Creator III
Partner - Creator III

You can write the Set Analysis in front of the expression:

{$<Year {'2024'}>} Sum(A)
{$<Year {'2024'}>} $(v_total_count)

 

Giuseppe_Alleruzzo
Contributor II
Contributor II
Author

I tried and into the chart i visualize "Garbage after expression: "$" "

Clement15
Partner - Specialist
Partner - Specialist

What type of chart do you use?

 

I've got this in a pivot table

 

Clement15_0-1708682231826.png

 

Giuseppe_Alleruzzo
Contributor II
Contributor II
Author

Straigth table, what do you have into variable v_test?

Clement15
Partner - Specialist
Partner - Specialist

I've got this : sum(FlagLancement)+sum(FlagLancement2)

It's not really useful. I created it for the test.

 

 

Giuseppe_Alleruzzo
Contributor II
Contributor II
Author

ok thank you, what do you suggest as an alternative?

Clement15
Partner - Specialist
Partner - Specialist

I don't understand the request. Doesn't work on your end? The measure also works in a straight table.

Giuseppe_Alleruzzo
Contributor II
Contributor II
Author

I made another test, into variable v_test i put only one sum

Giuseppe_Alleruzzo_1-1708684897203.png

Giuseppe_Alleruzzo_0-1708684786197.png

Giuseppe_Alleruzzo_2-1708685589868.png

 

Do you know why into the definition of the expression I see "Expression OK" and into the formula all underlined in red, as if there was a mistake?

I don't understand