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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
CezarioAbrantes
Contributor III
Contributor III

Filter in a dimension

Hi. Could you help me to apply a filter in a dimension? Is it possible? I'm a beginner in Qlik and programming, since I am administrator and not direct-related to "IT world".

I have a dimension called "Monthly Analysis" in the basis, where I classify the data of the months as "Current Month", "Previous Month", "Last Year" and "N/A".

I am creating a table to compare the data of the "Current Month" with "Previous Month", but I did not want to set a filter in every measure, since there are many measures in this table. I wanted to use a filter in the dimension. I thought about something like this, but it's not working. It appers the error "Invalid dimension":

={< [Monthly Analysis] = {'Current Month','Previous Month'} >}

I also tried to use another dimension to set this filter, but it didn't work as well:

=({< [Monthly Analysis] = {'Current Month','Previous Month'} >} [Year-Month])

Thanks

Cezário Abrantes

10 Replies
sunny_talwar

You can try this

Aggr(
    Only({<[Monthly Analysis] = {'Current Month', 'Previous Month'}>} [Year-Month])
, [Year-Month])
CezarioAbrantes
Contributor III
Contributor III
Author

I tried this and it is almost what I need, but the other months continue appearing.

In the image attached, 2019-11 is Current Month and 2019-10 is Previous Month (this is correct).

But take a look at the images attached. There is also the first block (-) that is summing up all the other months. I need this block to be ignored in this analysis, it means, I want only Current and Previus Month.

Do you know what to do now?

Thanks!

sunny_talwar

All you need to do is to uncheck 'Include null values' within your Dimension.

CezarioAbrantes
Contributor III
Contributor III
Author

Brilliant!

Now, I need to calculate the variation between these 2 months. Some measures will be less, others will be division. Could you help me with it?

Thanks!

sunny_talwar

Would you be able to elaborate on this with an example?

CezarioAbrantes
Contributor III
Contributor III
Author

I really don't have any idea about how to do this on Qlik, but take a look at this sheet (green columns - P to X). That's what I need to do (the numbers are not the same of the images, it is just to show you the Excel functions).

sunny_talwar

Are you trying to do this in a regular table or pivot table?

CezarioAbrantes
Contributor III
Contributor III
Author

Pivot table, cuz it is better to compare the months "in the eye". But if it is not possible to do these calcs in pivot table, I can change to normal one, but it's not the best.

sunny_talwar

So, right now you have 3 dimensions and 7 expressions?