Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Jerome56
Contributor
Contributor

See 2 different dimensions in a table or pivot table

Hello,

First, sorry if my question seems simple. I'm new to Qlik Sense and I'm not really a developper, just a regular user trying to learn step by step.

I have created some "Dimensions" like :

  • 'Last Month' to display Last Month Turnover for example. Expression looks like : =if(MM = $(MaxMonth),'Last Month')
  • 'YTD' to display last years turnover up to current month. Expression looks like : =if(MM <= $(MaxMonth), 'YTD')

With this 2 measures, I am able to create various table and pivot tables like

> Last Month | TO 2018 TO 2019 | etc.
> YTD | TO 2018 TO 2019 | etc.

But until now I haven't found a way to display both information in 2 different lines in the the same table. I have to create one table to display "Last Month" infos, and one table to display "YTD" infos. 

I've spent a lot of time today but can't find how to do it.

The closest I got is to create a dimension with : =if(MM = $(MaxMonth),'Last Month') & if(MM <= $(MaxMonth), 'YTD').
It get me 2 distinct line but amounts are incorrect because last month amount is removed from YTD amount, and both lines name are "Last MonthYTD"  and "YTD" instead of "YTD" and "Last Month"

Hope I was clear enough.

Thanks a lot for your help,

Jerome

Capture d’écran 2020-01-29 à 22.37.47.png

Labels (1)
2 Replies
Vegar
MVP
MVP

What if you don't set the logic in the dimension but do it in the expressions?

Dimension is Year without any adjusments

Expression Month is:  Sum({<Date, Month ={"$(=maxstring(Month))"}>}Sales)

Expression YTD is:  Sum({<Date, Month ={"<=$(=max(Month))"},>}Sales)

image.png

Jerome56
Contributor
Contributor
Author

Hello Vegar,

Thanks a lot for your answer.
However I believe my need is a bit different from what your suggest.
Below is a screen capture to give you more input about what I am trying to accomplish.
In the screenshot, I show 3 things :

1. One pivot table with my "Last Month" Dimension and various Measures associated to it. As a reminder, my last month dimension is  =if(MM = $(MaxMonth),'Last Month')

2. One pivot table with my "YTD" Dimension and various Measures associated to it. As a reminder, my YTD dimension is  =if(MM <= $(MaxMonth), 'YTD')

3. The Pivot Table I am trying to do but who currently does not work, with associated settings you can see on the right. The last expression I tried for this "Test" Dimension is : =if(MM = $(MaxMonth),'Last Month') & if(MM <= $(MaxMonth), 'YTD'). But as you can see, labels and numbers are incorrect in table 3.

 

Capture d’écran 2020-01-30 à 08.45.41.png